Skip to content

Commit

Permalink
stringify to print escaped characters raw
Browse files Browse the repository at this point in the history
  • Loading branch information
craigtaub committed Jan 8, 2019
1 parent 5ad9a14 commit 2acf1bf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/cli/run-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ exports.handleFiles = ({
// give full message details when only 1 file is missing
const noneFoundMsg =
unmatched.length === 1
? `Error: No test files found: ${unmatched[0].pattern}`
? `Error: No test files found: ${JSON.stringify(unmatched[0].pattern)}` // stringify to print escaped characters raw
: 'Error: No test files found';
console.error(ansi.red(noneFoundMsg));
process.exit(1);
Expand Down
7 changes: 4 additions & 3 deletions test/integration/glob.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('globbing', function() {
expect(
results.stderr,
'to contain',
'Error: No test files found: ./*-none.js'
'Error: No test files found: "./*-none.js"'
);
},
done
Expand All @@ -40,6 +40,7 @@ describe('globbing', function() {
'./*-none.js ./*-none-twice.js',
function(results) {
expect(results.stderr, 'to contain', 'Error: No test files found');
expect(results.stderr, 'not to contain', '*-none');
},
done
);
Expand Down Expand Up @@ -87,7 +88,7 @@ describe('globbing', function() {
expect(
results.stderr,
'to contain',
'Error: No test files found: ./*-none.js'
'Error: No test files found: "./*-none.js"'
);
},
done
Expand Down Expand Up @@ -145,7 +146,7 @@ describe('globbing', function() {
expect(
results.stderr,
'to contain',
'Error: No test files found: ./**/*-none.js'
'Error: No test files found: "./**/*-none.js"'
);
},
done
Expand Down

0 comments on commit 2acf1bf

Please sign in to comment.