Permalink
Browse files

Recognize snapshot files as source files

Fixes #1511.
  • Loading branch information...
itaisteinherz authored and novemberborn committed Feb 10, 2019
1 parent 65133a8 commit d066f6fbc06ab2fa2d391ff373f5f09b2585b900
Showing with 4 additions and 1 deletion.
  1. +1 −1 lib/ava-files.js
  2. +3 −0 test/ava-files.js
@@ -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);
@@ -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');

0 comments on commit d066f6f

Please sign in to comment.