From d066f6fbc06ab2fa2d391ff373f5f09b2585b900 Mon Sep 17 00:00:00 2001 From: Itai Steinherz Date: Sun, 10 Feb 2019 18:42:36 +0200 Subject: [PATCH] Recognize snapshot files as source files Fixes #1511. --- lib/ava-files.js | 2 +- test/ava-files.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ava-files.js b/lib/ava-files.js index f23f5d0ee..fa86436dc 100644 --- a/lib/ava-files.js +++ b/lib/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); diff --git a/test/ava-files.js b/test/ava-files.js index ac00e49ea..c3b82ad03 100644 --- a/test/ava-files.js +++ b/test/ava-files.js @@ -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');