@@ -4,8 +4,9 @@ const output = require('../src/output');
44const webpack = require ( 'webpack' ) ;
55const FriendlyErrorsWebpackPlugin = require ( '../src/friendly-errors-plugin' ) ;
66const MemoryFileSystem = require ( 'memory-fs' ) ;
7+ const path = require ( 'path' ) ;
78
8- const webpackPromise = function ( config , globalPlugins ) {
9+ const webpackPromise = function ( config , globalPlugins ) {
910 const compiler = webpack ( config ) ;
1011 compiler . outputFileSystem = new MemoryFileSystem ( ) ;
1112 if ( Array . isArray ( globalPlugins ) ) {
@@ -32,14 +33,14 @@ async function executeAndGetLogs(fixture, globalPlugins) {
3233 }
3334}
3435
35- it ( 'integration : success' , async ( ) => {
36+ it ( 'integration : success' , async ( ) => {
3637
3738 const logs = await executeAndGetLogs ( './fixtures/success/webpack.config' )
3839
3940 expect ( logs . join ( '\n' ) ) . toMatch ( / D O N E C o m p i l e d s u c c e s s f u l l y i n ( .\d * ) m s / ) ;
4041} ) ;
4142
42- it ( 'integration : module-errors' , async ( ) => {
43+ it ( 'integration : module-errors' , async ( ) => {
4344
4445 const logs = await executeAndGetLogs ( './fixtures/module-errors/webpack.config.js' ) ;
4546
@@ -55,27 +56,35 @@ it('integration : module-errors', async () => {
5556 ] ) ;
5657} ) ;
5758
58- it ( 'integration : should display eslint warnings' , async ( ) => {
59+ function filename ( filePath ) {
60+ return path . join ( __dirname , path . normalize ( filePath ) )
61+ }
62+
63+ it . only ( 'integration : should display eslint warnings' , async ( ) => {
5964
6065 const logs = await executeAndGetLogs ( './fixtures/eslint-warnings/webpack.config.js' ) ;
6166
62- expect ( logs ) . toEqual ( [
63- 'WARNING Compiled with 1 warnings' ,
64- '' ,
65- 'warning in ./test/fixtures/eslint-warnings/index.js' ,
66- '' ,
67- `${ __dirname } /fixtures/eslint-warnings/index.js
67+ expect ( logs . join ( '\n' ) ) . toEqual (
68+ `WARNING Compiled with 2 warnings
69+
70+ ${ filename ( 'fixtures/eslint-warnings/index.js' ) }
71+ 3:7 warning 'unused' is assigned a value but never used no-unused-vars
72+ 4:7 warning 'unused2' is assigned a value but never used no-unused-vars
73+
74+ ✖ 2 problems (0 errors, 2 warnings)
75+
76+ ${ filename ( 'fixtures/eslint-warnings/module.js' ) }
6877 1:7 warning 'unused' is assigned a value but never used no-unused-vars
6978
70- ✖ 1 problem (0 errors, 1 warning)` ,
71- '' ,
72- ' You may use special comments to disable some warnings.' ,
73- ' Use // eslint-disable-next-line to ignore the next line.' ,
74- ' Use /* eslint-disable */ to ignore all warnings in a file.'
75- ] ) ;
79+ ✖ 1 problem (0 errors, 1 warning)
80+
81+ You may use special comments to disable some warnings.
82+ Use // eslint-disable-next-line to ignore the next line.
83+ Use /* eslint-disable */ to ignore all warnings in a file.`
84+ )
7685} ) ;
7786
78- it ( 'integration : babel syntax error' , async ( ) => {
87+ it ( 'integration : babel syntax error' , async ( ) => {
7988
8089 const logs = await executeAndGetLogs ( './fixtures/babel-syntax/webpack.config' ) ;
8190
@@ -96,7 +105,7 @@ it('integration : babel syntax error', async () => {
96105 ] ) ;
97106} ) ;
98107
99- it ( 'integration : webpack multi compiler : success' , async ( ) => {
108+ it ( 'integration : webpack multi compiler : success' , async ( ) => {
100109
101110 // We apply the plugin directly to the compiler when targeting multi-compiler
102111 let globalPlugins = [ new FriendlyErrorsWebpackPlugin ( ) ] ;
@@ -105,7 +114,7 @@ it('integration : webpack multi compiler : success', async () => {
105114 expect ( logs . join ( '\n' ) ) . toMatch ( / D O N E C o m p i l e d s u c c e s s f u l l y i n ( .\d * ) m s / )
106115} ) ;
107116
108- it ( 'integration : webpack multi compiler : module-errors' , async ( ) => {
117+ it ( 'integration : webpack multi compiler : module-errors' , async ( ) => {
109118
110119 // We apply the plugin directly to the compiler when targeting multi-compiler
111120 let globalPlugins = [ new FriendlyErrorsWebpackPlugin ( ) ] ;
0 commit comments