Skip to content

Commit

Permalink
Recognize snapshot files as source files
Browse files Browse the repository at this point in the history
Fixes #1511.
  • Loading branch information
itaisteinherz authored and novemberborn committed Feb 10, 2019
1 parent 65133a8 commit d066f6f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ava-files.js
Expand Up @@ -171,7 +171,7 @@ class AvaFiles {

// Same defaults as used for Chokidar
if (!hasPositivePattern) {
mixedPatterns = ['package.json', '**/*.js'].concat(mixedPatterns);
mixedPatterns = ['package.json', '**/*.js', '**/*.snap'].concat(mixedPatterns);
}

filePath = matchable(filePath);
Expand Down
3 changes: 3 additions & 0 deletions test/ava-files.js
Expand Up @@ -73,6 +73,9 @@ test('sourceMatcher - defaults', t => {
isSource('fixtures/foo.js');
isSource('helpers/foo.js');

isSource('snapshots/foo.js.snap');
isSource('snapshots/bar.js.snap');

// TODO: Watcher should probably track any required file that matches the source pattern and has a require extension installed for the given extension.
notSource('foo-bar.json');
notSource('foo-bar.coffee');
Expand Down

0 comments on commit d066f6f

Please sign in to comment.