Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 34e07fa

Browse files
committed
Attempt to parse JSON only, otherwise npm start silently hangs forever on pollutants such as .DS_Store
1 parent 2750392 commit 34e07fa

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

devtools/test_dashboard/server.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,11 @@ function readFiles(files) {
7272
}
7373

7474
function createMocksList(files) {
75-
var mocksList = files.map(function(file) {
75+
76+
// eliminate pollutants (e.g .DS_Store) that can accumulate in the mock directory
77+
var jsonFiles = files.filter(function(file) {return file.extname === '.json';});
78+
79+
var mocksList = jsonFiles.map(function(file) {
7680
var contents = JSON.parse(file.contents);
7781

7882
// get plot type keywords from mocks

0 commit comments

Comments
 (0)