From 9f73f51ba731b0979fceecdb55e4e0ad75d6b6f2 Mon Sep 17 00:00:00 2001 From: Robert Monfera Date: Sun, 12 Jun 2016 23:48:16 +0200 Subject: [PATCH] #581c ignore files in the mock directory that aren't .json (e.g. .DS_Store) (cherry picked from commit 8240de2) --- test/image/compare_pixels_test.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/image/compare_pixels_test.js b/test/image/compare_pixels_test.js index 69c5af8be00..2e87e52a4f9 100644 --- a/test/image/compare_pixels_test.js +++ b/test/image/compare_pixels_test.js @@ -36,7 +36,10 @@ else runSingle(userFileName); function runAll() { test('testing mocks', function(t) { - var allMocks = fs.readdirSync(constants.pathToTestImageMocks); + var fileNames = fs.readdirSync(constants.pathToTestImageMocks); + + // eliminate pollutants (e.g .DS_Store) that can accumulate in the mock directory + var allMocks = fileNames.filter(function(name) {return name.slice(-5) === '.json';}); /* Test cases: *