Skip to content

Test improve snapshot testing #2726

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from
Closed
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
294 changes: 294 additions & 0 deletions test/build/basic/__snapshots__/basic.test.js.snap.webpack4
Original file line number Diff line number Diff line change
@@ -0,0 +1,294 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`bundle command should log error and suggest right name on the "buil" command: stderr 1`] = `
"[webpack-cli] Unknown command or entry 'buil'
[webpack-cli] Did you mean 'build' (alias 'bundle, b')?
[webpack-cli] Run 'webpack --help' to see available commands and options"
`;

exports[`bundle command should log error and suggest right name on the "buil" command: stdout 1`] = `""`;

exports[`bundle command should log supplied config when logging level is log: stderr 1`] = `
" [webpack-cli] Compiler starting...
[webpack-cli] Compiler is using config: '<cwd>/log.config.js'
[webpack-cli] Compiler finished"
`;

exports[`bundle command should log supplied config when logging level is log: stdout 1`] = `
"Hash: <hash>
Version: webpack x.x.x
Time: <compile time>
Built at: <built time>
Asset Size Chunks Chunk Names
main.js <size> <size-abbreviation> main [emitted] main
Entrypoint main = main.js
[./src/index.js] <size> <size-abbreviation> {main} [built]"
`;

exports[`bundle command should work with "bundle" alias: stderr 1`] = `""`;

exports[`bundle command should work with "bundle" alias: stdout 1`] = `
"Hash: <hash>
Version: webpack x.x.x
Time: <compile time>
Built at: <built time>
Asset Size Chunks Chunk Names
main.js <size> <size-abbreviation> 0 [emitted] main
Entrypoint main = main.js
[0] ./src/index.js <size> <size-abbreviation> {0} [built]

WARNING in configuration
The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment.
You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/configuration/mode/"
`;

exports[`bundle command should work with and override entries from the configuration: stderr 1`] = `""`;

exports[`bundle command should work with and override entries from the configuration: stdout 1`] = `
"Hash: <hash>
Version: webpack x.x.x
Time: <compile time>
Built at: <built time>
Asset Size Chunks Chunk Names
main.js <size> <size-abbreviation> main [emitted] main
Entrypoint main = main.js
[0] multi ./src/index.js ./src/other.js <size> <size-abbreviation> {main} [built]
[./src/index.js] <size> <size-abbreviation> {main} [built]
[./src/other.js] <size> <size-abbreviation> {main} [built]"
`;

exports[`bundle command should work with entries syntax using the "b" alias: stderr 1`] = `""`;

exports[`bundle command should work with entries syntax using the "b" alias: stdout 1`] = `
"Hash: <hash>
Version: webpack x.x.x
Time: <compile time>
Built at: <built time>
Asset Size Chunks Chunk Names
main.js <size> <size-abbreviation> 0 [emitted] main
Entrypoint main = main.js
[0] multi ./src/index.js <size> <size-abbreviation> {0} [built]
[1] ./src/index.js <size> <size-abbreviation> {0} [built]

WARNING in configuration
The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment.
You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/configuration/mode/"
`;

exports[`bundle command should work with entries syntax using the "build" alias: stderr 1`] = `""`;

exports[`bundle command should work with entries syntax using the "build" alias: stdout 1`] = `
"Hash: <hash>
Version: webpack x.x.x
Time: <compile time>
Built at: <built time>
Asset Size Chunks Chunk Names
main.js <size> <size-abbreviation> 0 [emitted] main
Entrypoint main = main.js
[0] multi ./src/index.js <size> <size-abbreviation> {0} [built]
[1] ./src/index.js <size> <size-abbreviation> {0} [built]

WARNING in configuration
The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment.
You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/configuration/mode/"
`;

exports[`bundle command should work with entries syntax using the "bundle" alias: stderr 1`] = `""`;

exports[`bundle command should work with entries syntax using the "bundle" alias: stdout 1`] = `
"Hash: <hash>
Version: webpack x.x.x
Time: <compile time>
Built at: <built time>
Asset Size Chunks Chunk Names
main.js <size> <size-abbreviation> 0 [emitted] main
Entrypoint main = main.js
[0] multi ./src/index.js <size> <size-abbreviation> {0} [built]
[1] ./src/index.js <size> <size-abbreviation> {0} [built]

WARNING in configuration
The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment.
You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/configuration/mode/"
`;

exports[`bundle command should work with multiple entries syntax using the "build" alias and options: stderr 1`] = `""`;

exports[`bundle command should work with multiple entries syntax using the "build" alias and options: stderr 2`] = `""`;

exports[`bundle command should work with multiple entries syntax using the "build" alias and options: stdout 1`] = `
"Hash: <hash>
Version: webpack x.x.x
Time: <compile time>
Built at: <built time>
Asset Size Chunks Chunk Names
main.js <size> <size-abbreviation> main [emitted] main
Entrypoint main = main.js
[0] multi ./src/index.js ./src/other.js <size> <size-abbreviation> {main} [built]
[./src/index.js] <size> <size-abbreviation> {main} [built]
[./src/other.js] <size> <size-abbreviation> {main} [built]"
`;

exports[`bundle command should work with multiple entries syntax using the "build" alias and options: stdout 2`] = `
"Hash: <hash>
Version: webpack x.x.x
Time: <compile time>
Built at: <built time>
Asset Size Chunks Chunk Names
main.js <size> <size-abbreviation> main [emitted] main
Entrypoint main = main.js
[0] multi ./src/index.js ./src/other.js <size> <size-abbreviation> {main} [built]
[./src/index.js] <size> <size-abbreviation> {main} [built]
[./src/other.js] <size> <size-abbreviation> {main} [built]"
`;

exports[`bundle command should work with multiple entries syntax using the "build" alias: stderr 1`] = `""`;

exports[`bundle command should work with multiple entries syntax using the "build" alias: stdout 1`] = `
"Hash: <hash>
Version: webpack x.x.x
Time: <compile time>
Built at: <built time>
Asset Size Chunks Chunk Names
main.js <size> <size-abbreviation> 0 [emitted] main
Entrypoint main = main.js
[0] multi ./src/index.js ./src/other.js <size> <size-abbreviation> {0} [built]
[1] ./src/index.js <size> <size-abbreviation> {0} [built]
[2] ./src/other.js <size> <size-abbreviation> {0} [built]

WARNING in configuration
The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment.
You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/configuration/mode/"
`;

exports[`bundle command should work with multiple entries syntax without command (default command): stderr 1`] = `""`;

exports[`bundle command should work with multiple entries syntax without command (default command): stdout 1`] = `
"Hash: <hash>
Version: webpack x.x.x
Time: <compile time>
Built at: <built time>
Asset Size Chunks Chunk Names
main.js <size> <size-abbreviation> 0 [emitted] main
Entrypoint main = main.js
[0] multi ./src/index.js ./src/other.js <size> <size-abbreviation> {0} [built]
[1] ./src/index.js <size> <size-abbreviation> {0} [built]
[2] ./src/other.js <size> <size-abbreviation> {0} [built]

WARNING in configuration
The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment.
You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/configuration/mode/"
`;

exports[`bundle command should work with multiple entries syntax without command with options #2 (default command): stderr 1`] = `""`;

exports[`bundle command should work with multiple entries syntax without command with options #2 (default command): stdout 1`] = `
"Hash: <hash>
Version: webpack x.x.x
Time: <compile time>
Built at: <built time>
Asset Size Chunks Chunk Names
main.js <size> <size-abbreviation> main [emitted] main
Entrypoint main = main.js
[0] multi ./src/index.js ./src/other.js <size> <size-abbreviation> {main} [built]
[./src/index.js] <size> <size-abbreviation> {main} [built]
[./src/other.js] <size> <size-abbreviation> {main} [built]"
`;

exports[`bundle command should work with multiple entries syntax without command with options #3 (default command): stderr 1`] = `""`;

exports[`bundle command should work with multiple entries syntax without command with options #3 (default command): stdout 1`] = `
"Hash: <hash>
Version: webpack x.x.x
Time: <compile time>
Built at: <built time>
Asset Size Chunks Chunk Names
main.js <size> <size-abbreviation> 0 [emitted] main
Entrypoint main = main.js
[0] multi ./src/index.js ./src/other.js ./src/again.js <size> <size-abbreviation> {0} [built]
[1] ./src/index.js <size> <size-abbreviation> {0} [built]
[2] ./src/other.js <size> <size-abbreviation> {0} [built]
[3] ./src/again.js <size> <size-abbreviation> {0} [built]

WARNING in configuration
The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment.
You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/configuration/mode/"
`;

exports[`bundle command should work with multiple entries syntax without command with options (default command): stderr 1`] = `""`;

exports[`bundle command should work with multiple entries syntax without command with options (default command): stdout 1`] = `
"Hash: <hash>
Version: webpack x.x.x
Time: <compile time>
Built at: <built time>
Asset Size Chunks Chunk Names
main.js <size> <size-abbreviation> main [emitted] main
Entrypoint main = main.js
[0] multi ./src/index.js ./src/other.js <size> <size-abbreviation> {main} [built]
[./src/index.js] <size> <size-abbreviation> {main} [built]
[./src/other.js] <size> <size-abbreviation> {main} [built]"
`;

exports[`bundle command should work with the "b" alias: stderr 1`] = `""`;

exports[`bundle command should work with the "b" alias: stdout 1`] = `
"Hash: <hash>
Version: webpack x.x.x
Time: <compile time>
Built at: <built time>
Asset Size Chunks Chunk Names
main.js <size> <size-abbreviation> 0 [emitted] main
Entrypoint main = main.js
[0] ./src/index.js <size> <size-abbreviation> {0} [built]

WARNING in configuration
The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment.
You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/configuration/mode/"
`;

exports[`bundle command should work with the "build" alias: stderr 1`] = `""`;

exports[`bundle command should work with the "build" alias: stdout 1`] = `
"Hash: <hash>
Version: webpack x.x.x
Time: <compile time>
Built at: <built time>
Asset Size Chunks Chunk Names
main.js <size> <size-abbreviation> 0 [emitted] main
Entrypoint main = main.js
[0] ./src/index.js <size> <size-abbreviation> {0} [built]

WARNING in configuration
The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment.
You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/configuration/mode/"
`;

exports[`bundle command should work without command (default command): stderr 1`] = `""`;

exports[`bundle command should work without command (default command): stdout 1`] = `
"Hash: <hash>
Version: webpack x.x.x
Time: <compile time>
Built at: <built time>
Asset Size Chunks Chunk Names
main.js <size> <size-abbreviation> 0 [emitted] main
Entrypoint main = main.js
[0] ./src/index.js <size> <size-abbreviation> {0} [built]

WARNING in configuration
The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment.
You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/configuration/mode/"
`;

exports[`bundle command should work without command and options (default command): stderr 1`] = `""`;

exports[`bundle command should work without command and options (default command): stdout 1`] = `
"Hash: <hash>
Version: webpack x.x.x
Time: <compile time>
Built at: <built time>
Asset Size Chunks Chunk Names
main.js <size> <size-abbreviation> main [emitted] main
Entrypoint main = main.js
[./src/index.js] <size> <size-abbreviation> {main} [built]"
`;
Loading