Skip to content

Commit 2074e1e

Browse files
author
Jørgen Sverre Lien Sellæg
committed
add tests for ignore emacs case
1 parent 027b95b commit 2074e1e

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

packages/react-dev-utils/__tests__/ignoredFiles.test.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,25 @@ describe('ignore watch files regex', () => {
6262

6363
expect(isIgnored).toBe(true);
6464
});
65+
66+
it('ignores emacs temporary files', () => {
67+
const appSrc = '/root/src/';
68+
const isIgnored = anymatch(ignoredFiles(appSrc), 'file.txt~');
69+
70+
expect(isIgnored).toBe(true);
71+
});
72+
73+
it('ignores emacs lock files', () => {
74+
const appSrc = '/root/src/';
75+
const isIgnored = anymatch(ignoredFiles(appSrc), '.#file.txt');
76+
77+
expect(isIgnored).toBe(true);
78+
});
79+
80+
it('ignores emacs backup files', () => {
81+
const appSrc = '/root/src/';
82+
const isIgnored = anymatch(ignoredFiles(appSrc), '.#file.txt#');
83+
84+
expect(isIgnored).toBe(true);
85+
});
6586
});

0 commit comments

Comments
 (0)