Skip to content
This repository has been archived by the owner on Jul 27, 2021. It is now read-only.

Fix win ci #19

Merged
merged 2 commits into from
Feb 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/output.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class Debugger {

captureConsole (args, method) {
if (this.capturing) {
this.capturedMessages.push(chalk.stripColor(args.join(' ').trim()));
this.capturedMessages.push(chalk.stripColor(args.join(' ')).trim());
} else {
method.apply(console, args);
}
Expand Down
6 changes: 5 additions & 1 deletion src/transformers/babelSyntax.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ function cleanStackTrace(message) {

function cleanMessage(message) {
return message
.replace('Module build failed: ', '');
// match until the last semicolon followed by a space
// this should match
// linux => "(SyntaxError: )Unexpected token (5:11)"
// windows => "(SyntaxError: C:/projects/index.js: )Unexpected token (5:11)"
.replace(/^Module build failed.*:\s/, 'Syntax Error: ');
}

function isBabelSyntaxError(e) {
Expand Down
17 changes: 8 additions & 9 deletions test/integration.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ it('integration : module-errors', async () => {
const logs = await executeAndGetLogs('./fixtures/module-errors/webpack.config.js');

expect(logs).toEqual([
' ERROR Failed to compile with 2 errors',
'ERROR Failed to compile with 2 errors',
'',
'These dependencies were not found in node_modules:',
'',
Expand All @@ -60,15 +60,14 @@ it('integration : should display eslint warnings', async () => {
const logs = await executeAndGetLogs('./fixtures/eslint-warnings/webpack.config.js');

expect(logs).toEqual([
' WARNING Compiled with 1 warnings',
'WARNING Compiled with 1 warnings',
'',
' warning in ./test/fixtures/eslint-warnings/index.js',
'warning in ./test/fixtures/eslint-warnings/index.js',
'',
`${__dirname}/fixtures/eslint-warnings/index.js
1:7 warning 'unused' is assigned a value but never used no-unused-vars

✖ 1 problem (0 errors, 1 warning)
`,
✖ 1 problem (0 errors, 1 warning)`,
'',
'You may use special comments to disable some warnings.',
'Use // eslint-disable-next-line to ignore the next line.',
Expand All @@ -81,11 +80,11 @@ it('integration : babel syntax error', async () => {
const logs = await executeAndGetLogs('./fixtures/babel-syntax/webpack.config');

expect(logs).toEqual([
' ERROR Failed to compile with 1 errors',
'ERROR Failed to compile with 1 errors',
'',
' error in ./test/fixtures/babel-syntax/index.js',
'error in ./test/fixtures/babel-syntax/index.js',
'',
`SyntaxError: Unexpected token (5:11)
`Syntax Error: Unexpected token (5:11)

3 |${' '}
4 | render() {
Expand Down Expand Up @@ -113,7 +112,7 @@ it('integration : webpack multi compiler : module-errors', async () => {
const logs = await executeAndGetLogs('./fixtures/multi-compiler-module-errors/webpack.config', globalPlugins);

expect(logs).toEqual([
' ERROR Failed to compile with 2 errors',
'ERROR Failed to compile with 2 errors',
'',
'These dependencies were not found in node_modules:',
'',
Expand Down
4 changes: 2 additions & 2 deletions test/unit/plugin/friendlyErrors.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ it('friendlyErrors : capture invalid message', () => {
});

expect(logs).toEqual([
' WAIT Compiling...',
'WAIT Compiling...',
''
]);
});
Expand All @@ -31,7 +31,7 @@ it('friendlyErrors : capture compilation without errors', () => {
});

expect(logs).toEqual([
' DONE Compiled successfully in 100ms',
'DONE Compiled successfully in 100ms',
''
]);
});
Expand Down