From 2acf1bfc3e10e1229f5f8d744b3245fbfa1cb537 Mon Sep 17 00:00:00 2001 From: Craig Taub Date: Tue, 8 Jan 2019 19:35:26 +0000 Subject: [PATCH] stringify to print escaped characters raw --- lib/cli/run-helpers.js | 2 +- test/integration/glob.spec.js | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/cli/run-helpers.js b/lib/cli/run-helpers.js index db50cc3d90..df53117fec 100644 --- a/lib/cli/run-helpers.js +++ b/lib/cli/run-helpers.js @@ -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); diff --git a/test/integration/glob.spec.js b/test/integration/glob.spec.js index 240184801e..4284320aa7 100644 --- a/test/integration/glob.spec.js +++ b/test/integration/glob.spec.js @@ -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 @@ -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 ); @@ -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 @@ -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