Skip to content

Commit

Permalink
chore: update Snapshots webpack 4
Browse files Browse the repository at this point in the history
  • Loading branch information
sibiraj-s committed Nov 6, 2020
1 parent 88859cc commit 16fae20
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 44 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ module.exports = {

### `deleteOriginalAssets`

Type: `Boolean|'keep-source-map'`
Type: `Boolean | 'keep-source-map'`
Default: `false`

Whether to delete the original assets or not.
Expand Down
41 changes: 0 additions & 41 deletions test/__snapshots__/compressionOptions-option.test.js.snap.webpack4
Original file line number Diff line number Diff line change
Expand Up @@ -41,47 +41,6 @@ exports[`"compressionOptions" option matches snapshot for custom options ({Objec

exports[`"compressionOptions" option matches snapshot for custom options ({Object}): warnings 1`] = `Array []`;

exports[`"compressionOptions" option matches snapshot without values: assets 1`] = `
Array [
Array [
"09a1a1112c577c2794359715edfcb5ac.png",
78117,
],
Array [
"09a1a1112c577c2794359715edfcb5ac.png.gz",
73160,
],
Array [
"23fc1d3ac606d117e05a140e0de79806.svg",
672,
],
Array [
"23fc1d3ac606d117e05a140e0de79806.svg.gz",
393,
],
Array [
"async.async.dcbdb1dd40763448b635.js",
249,
],
Array [
"async.async.dcbdb1dd40763448b635.js.gz",
171,
],
Array [
"main.82c6786e32f9c77b44ef.js",
11645,
],
Array [
"main.82c6786e32f9c77b44ef.js.gz",
3000,
],
]
`;

exports[`"compressionOptions" option matches snapshot without values: errors 1`] = `Array []`;

exports[`"compressionOptions" option matches snapshot without values: warnings 1`] = `Array []`;

exports[`"compressionOptions" option set default compression level to maximum for brotli: assets 1`] = `
Array [
Array [
Expand Down
33 changes: 33 additions & 0 deletions test/__snapshots__/deleteOriginalAssets.test.js.snap.webpack4
Original file line number Diff line number Diff line change
@@ -1,5 +1,38 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`"deleteOriginalAssets" option should delete original assets and keep source maps with option 'keep-source-map': assets 1`] = `
Array [
Array [
"09a1a1112c577c2794359715edfcb5ac.png",
78117,
],
Array [
"23fc1d3ac606d117e05a140e0de79806.svg",
393,
],
Array [
"async.async.dcbdb1dd40763448b635.js",
220,
],
Array [
"async.async.dcbdb1dd40763448b635.js.map",
132,
],
Array [
"main.82c6786e32f9c77b44ef.js",
3044,
],
Array [
"main.82c6786e32f9c77b44ef.js.map",
10291,
],
]
`;

exports[`"deleteOriginalAssets" option should delete original assets and keep source maps with option 'keep-source-map': errors 1`] = `Array []`;

exports[`"deleteOriginalAssets" option should delete original assets and keep source maps with option 'keep-source-map': warnings 1`] = `Array []`;

exports[`"deleteOriginalAssets" option should work and delete original assets: assets 1`] = `
Array [
Array [
Expand Down
8 changes: 6 additions & 2 deletions test/__snapshots__/validate-options.test.js.snap.webpack4
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,12 @@ exports[`validate options should throw an error on the "compressionOptions" opti

exports[`validate options should throw an error on the "deleteOriginalAssets" option with "true" value 1`] = `
"Invalid options object. Compression Plugin has been initialized using an options object that does not match the API schema.
- options.deleteOriginalAssets should be a boolean.
-> Whether to delete the original assets or not."
- options.deleteOriginalAssets should be one of these:
boolean | \\"keep-source-map\\"
-> Whether to delete the original assets or not.
Details:
* options.deleteOriginalAssets should be a boolean.
* options.deleteOriginalAssets should be \\"keep-source-map\\"."
`;

exports[`validate options should throw an error on the "exclude" option with "[{},"foo",true]" value 1`] = `
Expand Down

0 comments on commit 16fae20

Please sign in to comment.