diff --git a/test/__snapshots__/import-option.test.js.snap b/test/__snapshots__/import-option.test.js.snap index a1b65553..cb5d7f4b 100644 --- a/test/__snapshots__/import-option.test.js.snap +++ b/test/__snapshots__/import-option.test.js.snap @@ -1,14 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`"import" option should emit warning when unresolved import: errors 1`] = ` -Array [ - "ModuleBuildError: Module build failed (from \`replaced original path\`): -Error: Can't resolve 'unresolved-file.css' in '/test/fixtures/import'", -] -`; - -exports[`"import" option should emit warning when unresolved import: warnings 1`] = `Array []`; - exports[`"import" option should keep original order: errors 1`] = `Array []`; exports[`"import" option should keep original order: module 1`] = ` @@ -278,6 +269,15 @@ Array [ exports[`"import" option should respect style field in package.json: warnings 1`] = `Array []`; +exports[`"import" option should throw an error on unresolved import: errors 1`] = ` +Array [ + "ModuleBuildError: Module build failed (from \`replaced original path\`): +Error: Can't resolve 'unresolved-file.css' in '/test/fixtures/import'", +] +`; + +exports[`"import" option should throw an error on unresolved import: warnings 1`] = `Array []`; + exports[`"import" option should work resolve order: local -> node_modules -> alias: errors 1`] = `Array []`; exports[`"import" option should work resolve order: local -> node_modules -> alias: module 1`] = ` diff --git a/test/__snapshots__/modules-option.test.js.snap b/test/__snapshots__/modules-option.test.js.snap index 0c4189f3..ec3f187b 100644 --- a/test/__snapshots__/modules-option.test.js.snap +++ b/test/__snapshots__/modules-option.test.js.snap @@ -1433,14 +1433,14 @@ a { exports[`"modules" option should support resolving in composes: warnings 1`] = `Array []`; -exports[`"modules" option should throw error when unresolved import: errors 1`] = ` +exports[`"modules" option should throw an error on unresolved import: errors 1`] = ` Array [ "ModuleBuildError: Module build failed (from \`replaced original path\`): -Error: Can't resolve './//exammple.com/unresolved.css' in '/test/fixtures/modules/unresolved'", +Error: Can't resolve './unresolved.css' in '/test/fixtures/modules/unresolved'", ] `; -exports[`"modules" option should throw error when unresolved import: warnings 1`] = `Array []`; +exports[`"modules" option should throw an error on unresolved import: warnings 1`] = `Array []`; exports[`"modules" option should work and correctly replace escaped symbols: errors 1`] = `Array []`; diff --git a/test/__snapshots__/url-option.test.js.snap b/test/__snapshots__/url-option.test.js.snap index 91eabd84..02609964 100644 --- a/test/__snapshots__/url-option.test.js.snap +++ b/test/__snapshots__/url-option.test.js.snap @@ -1,13 +1,13 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`"url" option should emit warning when unresolved import: errors 1`] = ` +exports[`"url" option should throw an error on unresolved import: errors 1`] = ` Array [ "ModuleBuildError: Module build failed (from \`replaced original path\`): Error: Can't resolve 'unresolved.png' in '/test/fixtures/url'", ] `; -exports[`"url" option should emit warning when unresolved import: warnings 1`] = `Array []`; +exports[`"url" option should throw an error on unresolved import: warnings 1`] = `Array []`; exports[`"url" option should work when not specified: errors 1`] = `Array []`; diff --git a/test/fixtures/modules/unresolved/source.css b/test/fixtures/modules/unresolved/source.css index 079eb8b4..964b60b4 100644 --- a/test/fixtures/modules/unresolved/source.css +++ b/test/fixtures/modules/unresolved/source.css @@ -1,4 +1,4 @@ -@value foo from '//exammple.com/unresolved.css'; +@value foo from './unresolved.css'; .className { color: foo; diff --git a/test/import-option.test.js b/test/import-option.test.js index e0376e89..6a3d4198 100644 --- a/test/import-option.test.js +++ b/test/import-option.test.js @@ -143,7 +143,7 @@ describe('"import" option', () => { expect(getErrors(stats)).toMatchSnapshot('errors'); }); - it('should emit warning when unresolved import', async () => { + it('should throw an error on unresolved import', async () => { const compiler = getCompiler('./import/unresolved.js'); const stats = await compile(compiler); diff --git a/test/modules-option.test.js b/test/modules-option.test.js index c899576d..158b7d78 100644 --- a/test/modules-option.test.js +++ b/test/modules-option.test.js @@ -830,7 +830,7 @@ describe('"modules" option', () => { expect(getErrors(stats)).toMatchSnapshot('errors'); }); - it('should throw error when unresolved import', async () => { + it('should throw an error on unresolved import', async () => { const compiler = getCompiler('./modules/unresolved/source.js', { modules: true, }); diff --git a/test/url-option.test.js b/test/url-option.test.js index 730d9541..bdfbcaf5 100644 --- a/test/url-option.test.js +++ b/test/url-option.test.js @@ -67,7 +67,7 @@ describe('"url" option', () => { expect(getErrors(stats)).toMatchSnapshot('errors'); }); - it('should emit warning when unresolved import', async () => { + it('should throw an error on unresolved import', async () => { const compiler = getCompiler('./url/url-unresolved.js'); const stats = await compile(compiler);