Skip to content

Commit

Permalink
test: persistent cache (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
evilebottnawi authored Aug 22, 2020
1 parent aff77eb commit b389b4f
Show file tree
Hide file tree
Showing 13 changed files with 165 additions and 27 deletions.
68 changes: 67 additions & 1 deletion test/CssMinimizerPlugin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,10 @@ describe('CssMinimizerPlugin', () => {
test: /entry.js$/i,
use: [
{
loader: path.resolve(__dirname, './helpers/preLoader'),
loader: path.resolve(
__dirname,
'./helpers/emitAssetInChildCompilationLoader'
),
},
],
},
Expand Down Expand Up @@ -445,4 +448,67 @@ describe('CssMinimizerPlugin', () => {
expect(getWarnings(stats)).toMatchSnapshot('warnings');
}
});

it('should work in watch mode', async () => {
const compiler = getCompiler({
entry: {
foo: `${__dirname}/fixtures/simple.js`,
},
plugins: [],
module: {
rules: [
{
test: /.s?css$/i,
use: ['css-loader'],
},
{
test: /simple-emit.js$/i,
loader: require.resolve('./helpers/emitAssetLoader.js'),
},
{
test: /simple-emit-2.js$/i,
loader: require.resolve('./helpers/emitAssetLoader2.js'),
},
],
},
});

new CssMinimizerPlugin().apply(compiler);

const stats = await compile(compiler);

if (getCompiler.isWebpack4()) {
expect(
Object.keys(stats.compilation.assets).filter(
(assetName) => stats.compilation.assets[assetName].emitted
).length
).toBe(4);
} else {
expect(stats.compilation.emittedAssets.size).toBe(4);
}

expect(readAssets(compiler, stats, '.css')).toMatchSnapshot('assets');
expect(getWarnings(stats)).toMatchSnapshot('errors');
expect(getErrors(stats)).toMatchSnapshot('warnings');

await new Promise(async (resolve) => {
const newStats = await compile(compiler);

if (getCompiler.isWebpack4()) {
expect(
Object.keys(newStats.compilation.assets).filter(
(assetName) => newStats.compilation.assets[assetName].emitted
).length
).toBe(0);
} else {
expect(newStats.compilation.emittedAssets.size).toBe(0);
}

expect(readAssets(compiler, newStats, '.css')).toMatchSnapshot('assets');
expect(getWarnings(newStats)).toMatchSnapshot('errors');
expect(getErrors(newStats)).toMatchSnapshot('warnings');

resolve();
});
});
});
22 changes: 22 additions & 0 deletions test/__snapshots__/CssMinimizerPlugin.test.js.snap.webpack4
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,28 @@ exports[`CssMinimizerPlugin should work and show minimized assets in stats: erro

exports[`CssMinimizerPlugin should work and show minimized assets in stats: warnings 1`] = `Array []`;

exports[`CssMinimizerPlugin should work in watch mode: assets 1`] = `
Object {
"style-2.css": "a{color:coral}",
"style.css": "a{color:red}",
}
`;

exports[`CssMinimizerPlugin should work in watch mode: assets 2`] = `
Object {
"style-2.css": "a{color:coral}",
"style.css": "a{color:red}",
}
`;

exports[`CssMinimizerPlugin should work in watch mode: errors 1`] = `Array []`;

exports[`CssMinimizerPlugin should work in watch mode: errors 2`] = `Array []`;

exports[`CssMinimizerPlugin should work in watch mode: warnings 1`] = `Array []`;

exports[`CssMinimizerPlugin should work in watch mode: warnings 2`] = `Array []`;

exports[`CssMinimizerPlugin should work with assets using querystring: entry.css.map?v=test 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,SACF,CACA,EACE,UACF\\",\\"file\\":\\"entry.css?v=test\\",\\"sourcesContent\\":[\\"body {\\\\n color: red;\\\\n}\\\\na {\\\\n color: blue;\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`;

exports[`CssMinimizerPlugin should work with assets using querystring: entry.css?v=test 1`] = `
Expand Down
24 changes: 23 additions & 1 deletion test/__snapshots__/CssMinimizerPlugin.test.js.snap.webpack5
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ exports[`CssMinimizerPlugin should respect the hash options #1: warnings 1`] = `

exports[`CssMinimizerPlugin should work and generate real content hash: assets 1`] = `
Object {
"entry.19e4764f9c1d9fe130e2.655a1d8e7614dda9272e.1afdccbeaec4b0402d74.css": "body{color:red}a{color:#00f}",
"entry.19e4764f9c1d9fe130e2.2d6ce991710d63180e35.87eaf84ce322e15b3c17.css": "body{color:red}a{color:#00f}",
}
`;

Expand All @@ -79,6 +79,28 @@ exports[`CssMinimizerPlugin should work and show minimized assets in stats: erro

exports[`CssMinimizerPlugin should work and show minimized assets in stats: warnings 1`] = `Array []`;

exports[`CssMinimizerPlugin should work in watch mode: assets 1`] = `
Object {
"style-2.css": "a{color:coral}",
"style.css": "a{color:red}",
}
`;

exports[`CssMinimizerPlugin should work in watch mode: assets 2`] = `
Object {
"style-2.css": "a{color:coral}",
"style.css": "a{color:red}",
}
`;

exports[`CssMinimizerPlugin should work in watch mode: errors 1`] = `Array []`;

exports[`CssMinimizerPlugin should work in watch mode: errors 2`] = `Array []`;

exports[`CssMinimizerPlugin should work in watch mode: warnings 1`] = `Array []`;

exports[`CssMinimizerPlugin should work in watch mode: warnings 2`] = `Array []`;

exports[`CssMinimizerPlugin should work with assets using querystring: entry.css.map?v=test 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,SACF,CACA,EACE,UACF\\",\\"file\\":\\"entry.css?v=test\\",\\"sourcesContent\\":[\\"body {\\\\n color: red;\\\\n}\\\\na {\\\\n color: blue;\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`;

exports[`CssMinimizerPlugin should work with assets using querystring: entry.css?v=test 1`] = `
Expand Down
14 changes: 7 additions & 7 deletions test/__snapshots__/sourceMap-option.test.js.snap.webpack4
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ Object {
}
`;

exports[`when applied with "sourceMap" option matches snapshot for "true" value, using previous sourcemap: entry.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,gBCEA,SDFiB,CCCnB,OAGI,iBAAkB\\",\\"file\\":\\"entry.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n a {\\\\n text-align: center;\\\\n }\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`;
exports[`when applied with "sourceMap" option matches snapshot for "true" value, using previous sourcemap: entry.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,eAAiB,CCEjB,SDFiB,CCCnB,OAGI,iBAAkB\\",\\"file\\":\\"entry.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n a {\\\\n text-align: center;\\\\n }\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`;

exports[`when applied with "sourceMap" option matches snapshot for "true" value, using previous sourcemap: entry2.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,gBCEA,SDFiB,CCGlB,OAGC,iBAAkB\\",\\"file\\":\\"entry2.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n}\\\\n\\\\nbody a {\\\\n text-align: center;\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`;
exports[`when applied with "sourceMap" option matches snapshot for "true" value, using previous sourcemap: entry2.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,eAAiB,CCEjB,SDFiB,CCKnB,OACE,iBAAkB\\",\\"file\\":\\"entry2.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n}\\\\n\\\\nbody a {\\\\n text-align: center;\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`;

exports[`when applied with "sourceMap" option matches snapshot for "true" value, using previous sourcemap: errors 1`] = `Array []`;

Expand All @@ -48,9 +48,9 @@ Object {
}
`;

exports[`when applied with "sourceMap" option matches snapshot for "true" value, without previous sourcemap: entry.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,gBCEA,SDFiB,CCCnB,OAGI,iBAAkB\\",\\"file\\":\\"entry.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n a {\\\\n text-align: center;\\\\n }\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`;
exports[`when applied with "sourceMap" option matches snapshot for "true" value, without previous sourcemap: entry.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,eAAiB,CCEjB,SDFiB,CCCnB,OAGI,iBAAkB\\",\\"file\\":\\"entry.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n a {\\\\n text-align: center;\\\\n }\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`;

exports[`when applied with "sourceMap" option matches snapshot for "true" value, without previous sourcemap: entry2.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,gBCEA,SDFiB,CCGlB,OAGC,iBAAkB\\",\\"file\\":\\"entry2.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n}\\\\n\\\\nbody a {\\\\n text-align: center;\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`;
exports[`when applied with "sourceMap" option matches snapshot for "true" value, without previous sourcemap: entry2.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,eAAiB,CCEjB,SDFiB,CCKnB,OACE,iBAAkB\\",\\"file\\":\\"entry2.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n}\\\\n\\\\nbody a {\\\\n text-align: center;\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`;

exports[`when applied with "sourceMap" option matches snapshot for "true" value, without previous sourcemap: errors 1`] = `Array []`;

Expand All @@ -67,17 +67,17 @@ Object {

exports[`when applied with "sourceMap" option matches snapshot when using SourceMapDevToolPlugin (with filename, publicPath and fileContext options): errors 1`] = `Array []`;

exports[`when applied with "sourceMap" option matches snapshot when using SourceMapDevToolPlugin (with filename, publicPath and fileContext options): sourcemaps/entry.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,gBCEA,SDFiB,CCCnB,OAGI,iBAAkB\\",\\"file\\":\\"dist/entry.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n a {\\\\n text-align: center;\\\\n }\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`;
exports[`when applied with "sourceMap" option matches snapshot when using SourceMapDevToolPlugin (with filename, publicPath and fileContext options): sourcemaps/entry.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,eAAiB,CCEjB,SDFiB,CCCnB,OAGI,iBAAkB\\",\\"file\\":\\"dist/entry.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n a {\\\\n text-align: center;\\\\n }\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`;

exports[`when applied with "sourceMap" option matches snapshot when using SourceMapDevToolPlugin (with filename, publicPath and fileContext options): sourcemaps/entry2.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,gBCEA,SDFiB,CCGlB,OAGC,iBAAkB\\",\\"file\\":\\"dist/entry2.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n}\\\\n\\\\nbody a {\\\\n text-align: center;\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`;
exports[`when applied with "sourceMap" option matches snapshot when using SourceMapDevToolPlugin (with filename, publicPath and fileContext options): sourcemaps/entry2.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,eAAiB,CCEjB,SDFiB,CCKnB,OACE,iBAAkB\\",\\"file\\":\\"dist/entry2.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n}\\\\n\\\\nbody a {\\\\n text-align: center;\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`;

exports[`when applied with "sourceMap" option matches snapshot when using SourceMapDevToolPlugin (with filename, publicPath and fileContext options): warnings 1`] = `Array []`;

exports[`when applied with "sourceMap" option should emit warning when broken sourcemap: errors 1`] = `
Array [
"Error: broken-source-map.css from Css Minimizer
Error: \\"version\\" is a required argument.",
"ModuleBuildError: Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
"ModuleBuildError: Module build failed (from /node_modules/mini-css-extract-plugin/dist/loader.js):
Error: broken-source-map.css from Css Minimizer",
]
`;
Expand Down
14 changes: 7 additions & 7 deletions test/__snapshots__/sourceMap-option.test.js.snap.webpack5
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ Object {
}
`;

exports[`when applied with "sourceMap" option matches snapshot for "true" value, using previous sourcemap: entry.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,gBCEA,SDFiB,CCCnB,OAGI,iBAAkB\\",\\"file\\":\\"entry.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n a {\\\\n text-align: center;\\\\n }\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`;
exports[`when applied with "sourceMap" option matches snapshot for "true" value, using previous sourcemap: entry.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,eAAiB,CCEjB,SDFiB,CCCnB,OAGI,iBAAkB\\",\\"file\\":\\"entry.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n a {\\\\n text-align: center;\\\\n }\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`;

exports[`when applied with "sourceMap" option matches snapshot for "true" value, using previous sourcemap: entry2.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,gBCEA,SDFiB,CCGlB,OAGC,iBAAkB\\",\\"file\\":\\"entry2.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n}\\\\n\\\\nbody a {\\\\n text-align: center;\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`;
exports[`when applied with "sourceMap" option matches snapshot for "true" value, using previous sourcemap: entry2.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,eAAiB,CCEjB,SDFiB,CCKnB,OACE,iBAAkB\\",\\"file\\":\\"entry2.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n}\\\\n\\\\nbody a {\\\\n text-align: center;\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`;

exports[`when applied with "sourceMap" option matches snapshot for "true" value, using previous sourcemap: errors 1`] = `Array []`;

Expand All @@ -48,9 +48,9 @@ Object {
}
`;

exports[`when applied with "sourceMap" option matches snapshot for "true" value, without previous sourcemap: entry.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,gBCEA,SDFiB,CCCnB,OAGI,iBAAkB\\",\\"file\\":\\"entry.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n a {\\\\n text-align: center;\\\\n }\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`;
exports[`when applied with "sourceMap" option matches snapshot for "true" value, without previous sourcemap: entry.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,eAAiB,CCEjB,SDFiB,CCCnB,OAGI,iBAAkB\\",\\"file\\":\\"entry.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n a {\\\\n text-align: center;\\\\n }\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`;

exports[`when applied with "sourceMap" option matches snapshot for "true" value, without previous sourcemap: entry2.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,gBCEA,SDFiB,CCGlB,OAGC,iBAAkB\\",\\"file\\":\\"entry2.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n}\\\\n\\\\nbody a {\\\\n text-align: center;\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`;
exports[`when applied with "sourceMap" option matches snapshot for "true" value, without previous sourcemap: entry2.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,eAAiB,CCEjB,SDFiB,CCKnB,OACE,iBAAkB\\",\\"file\\":\\"entry2.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n}\\\\n\\\\nbody a {\\\\n text-align: center;\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`;

exports[`when applied with "sourceMap" option matches snapshot for "true" value, without previous sourcemap: errors 1`] = `Array []`;

Expand All @@ -67,17 +67,17 @@ Object {

exports[`when applied with "sourceMap" option matches snapshot when using SourceMapDevToolPlugin (with filename, publicPath and fileContext options): errors 1`] = `Array []`;

exports[`when applied with "sourceMap" option matches snapshot when using SourceMapDevToolPlugin (with filename, publicPath and fileContext options): sourcemaps/entry.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,gBCEA,SDFiB,CCCnB,OAGI,iBAAkB\\",\\"file\\":\\"dist/entry.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n a {\\\\n text-align: center;\\\\n }\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`;
exports[`when applied with "sourceMap" option matches snapshot when using SourceMapDevToolPlugin (with filename, publicPath and fileContext options): sourcemaps/entry.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,eAAiB,CCEjB,SDFiB,CCCnB,OAGI,iBAAkB\\",\\"file\\":\\"dist/entry.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n a {\\\\n text-align: center;\\\\n }\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`;

exports[`when applied with "sourceMap" option matches snapshot when using SourceMapDevToolPlugin (with filename, publicPath and fileContext options): sourcemaps/entry2.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,gBCEA,SDFiB,CCGlB,OAGC,iBAAkB\\",\\"file\\":\\"dist/entry2.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n}\\\\n\\\\nbody a {\\\\n text-align: center;\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`;
exports[`when applied with "sourceMap" option matches snapshot when using SourceMapDevToolPlugin (with filename, publicPath and fileContext options): sourcemaps/entry2.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,eAAiB,CCEjB,SDFiB,CCKnB,OACE,iBAAkB\\",\\"file\\":\\"dist/entry2.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n}\\\\n\\\\nbody a {\\\\n text-align: center;\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`;

exports[`when applied with "sourceMap" option matches snapshot when using SourceMapDevToolPlugin (with filename, publicPath and fileContext options): warnings 1`] = `Array []`;

exports[`when applied with "sourceMap" option should emit warning when broken sourcemap: errors 1`] = `
Array [
"Error: broken-source-map.css from Css Minimizer
Error: \\"version\\" is a required argument.",
"ModuleBuildError: Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
"ModuleBuildError: Module build failed (from ../../node_modules/mini-css-extract-plugin/dist/loader.js):
Error: broken-source-map.css from Css Minimizer",
]
`;
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/simple-async.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default 'bar';
1 change: 1 addition & 0 deletions test/fixtures/simple-emit-2.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default 'bar';
1 change: 1 addition & 0 deletions test/fixtures/simple-emit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default 'foo';
Loading

0 comments on commit b389b4f

Please sign in to comment.