Skip to content

chore: update jest from v29 to v30 #286

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
12,219 changes: 6,878 additions & 5,341 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"dependencies": {
"@jridgewell/trace-mapping": "^0.3.25",
"cssnano": "^7.0.4",
"jest-worker": "^29.7.0",
"jest-worker": "^30.0.0",
"postcss": "^8.4.40",
"schema-utils": "^4.2.0",
"serialize-javascript": "^6.0.2"
Expand All @@ -89,7 +89,7 @@
"@types/node": "^20.14.9",
"@types/serialize-javascript": "^5.0.4",
"@webpack-contrib/eslint-config-webpack": "^3.0.0",
"babel-jest": "^29.7.0",
"babel-jest": "^30.0.0",
"clean-css": "^5.3.3",
"copy-webpack-plugin": "^9.1.0",
"cross-env": "^7.0.3",
Expand All @@ -104,7 +104,7 @@
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"husky": "^9.1.4",
"jest": "^29.7.0",
"jest": "^30.0.0",
"lightningcss": "^1.25.1",
"lint-staged": "^15.2.8",
"memfs": "^4.11.1",
Expand Down
2 changes: 1 addition & 1 deletion test/__snapshots__/CssMinimizerPlugin.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ warning http://example.com/www/js/one.css:1:1]
exports[`CssMinimizerPlugin should build error: error 1`] = `
[
"Error: error.css from Css Minimizer plugin
/error.css:1:1: Unknown word [error.css:1,1]",
/error.css:1:1: Unknown word null [error.css:1,1]",
]
`;

Expand Down
211 changes: 188 additions & 23 deletions test/__snapshots__/minify-option.test.js.snap

Large diffs are not rendered by default.

65 changes: 60 additions & 5 deletions test/__snapshots__/sourceMap-option.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@ error-plugin: /dist/entry2.css:10:3: Postcss error [webpack://./sourcemap/foo.cs
]
`;

exports[`when applied with "sourceMap" option should work and emit warning on valid sourcemap and minimizer error: warnings 1`] = `[]`;
exports[`when applied with "sourceMap" option should work and emit warning on valid sourcemap and minimizer error: warnings 1`] = `
[
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
Deprecation The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.",
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
Deprecation Warning on line 0, column 8 of file:///test/fixtures/sourcemap/foo.css:0:8:",
]
`;

exports[`when applied with "sourceMap" option should work and emit warnings on broken sourcemaps: assets 1`] = `
{
Expand Down Expand Up @@ -39,6 +46,10 @@ exports[`when applied with "sourceMap" option should work and emit warnings on b
exports[`when applied with "sourceMap" option should work and emit warnings on broken sourcemaps: warnings 1`] = `
[
"Error: broken-source-map.css contains invalid source map",
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
Deprecation The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.",
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
Deprecation Warning on line 0, column 8 of file:///test/fixtures/sourcemap/foo.css:0:8:",
]
`;

Expand Down Expand Up @@ -83,7 +94,18 @@ exports[`when applied with "sourceMap" option should work with SourceMapDevToolP

exports[`when applied with "sourceMap" option should work with SourceMapDevToolPlugin plugin): errors 1`] = `[]`;

exports[`when applied with "sourceMap" option should work with SourceMapDevToolPlugin plugin): warnings 1`] = `[]`;
exports[`when applied with "sourceMap" option should work with SourceMapDevToolPlugin plugin): warnings 1`] = `
[
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
Deprecation The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.",
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
Deprecation The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.",
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
Deprecation Warning on line 0, column 8 of file:///test/fixtures/sourcemap/foo.css:0:8:",
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
Deprecation Warning on line 0, column 8 of file:///test/fixtures/sourcemap/foo.scss:0:8:",
]
`;

exports[`when applied with "sourceMap" option should work with the "devtool" option and the "parallel" option with "false" value: assets 1`] = `
{
Expand Down Expand Up @@ -126,7 +148,18 @@ exports[`when applied with "sourceMap" option should work with the "devtool" opt

exports[`when applied with "sourceMap" option should work with the "devtool" option and the "parallel" option with "false" value: errors 1`] = `[]`;

exports[`when applied with "sourceMap" option should work with the "devtool" option and the "parallel" option with "false" value: warnings 1`] = `[]`;
exports[`when applied with "sourceMap" option should work with the "devtool" option and the "parallel" option with "false" value: warnings 1`] = `
[
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
Deprecation The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.",
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
Deprecation The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.",
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
Deprecation Warning on line 0, column 8 of file:///test/fixtures/sourcemap/foo.css:0:8:",
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
Deprecation Warning on line 0, column 8 of file:///test/fixtures/sourcemap/foo.scss:0:8:",
]
`;

exports[`when applied with "sourceMap" option should work with the "devtool" option and the "parallel" option with "true" value: assets 1`] = `
{
Expand Down Expand Up @@ -169,7 +202,18 @@ exports[`when applied with "sourceMap" option should work with the "devtool" opt

exports[`when applied with "sourceMap" option should work with the "devtool" option and the "parallel" option with "true" value: errors 1`] = `[]`;

exports[`when applied with "sourceMap" option should work with the "devtool" option and the "parallel" option with "true" value: warnings 1`] = `[]`;
exports[`when applied with "sourceMap" option should work with the "devtool" option and the "parallel" option with "true" value: warnings 1`] = `
[
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
Deprecation The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.",
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
Deprecation The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.",
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
Deprecation Warning on line 0, column 8 of file:///test/fixtures/sourcemap/foo.css:0:8:",
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
Deprecation Warning on line 0, column 8 of file:///test/fixtures/sourcemap/foo.scss:0:8:",
]
`;

exports[`when applied with "sourceMap" option should work with the "devtool" option: assets 1`] = `
{
Expand Down Expand Up @@ -212,4 +256,15 @@ exports[`when applied with "sourceMap" option should work with the "devtool" opt

exports[`when applied with "sourceMap" option should work with the "devtool" option: errors 1`] = `[]`;

exports[`when applied with "sourceMap" option should work with the "devtool" option: warnings 1`] = `[]`;
exports[`when applied with "sourceMap" option should work with the "devtool" option: warnings 1`] = `
[
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
Deprecation The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.",
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
Deprecation The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.",
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
Deprecation Warning on line 0, column 8 of file:///test/fixtures/sourcemap/foo.css:0:8:",
"ModuleWarning: Module Warning (from ../../node_modules/sass-loader/dist/cjs.js):
Deprecation Warning on line 0, column 8 of file:///test/fixtures/sourcemap/foo.scss:0:8:",
]
`;
2 changes: 1 addition & 1 deletion test/__snapshots__/worker.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

exports[`worker should emit error: error 1`] = `
[
"/entry.css:1:1: Unknown word",
"/entry.css:1:1: Unknown word false",
]
`;

Expand Down
4 changes: 1 addition & 3 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ declare class CssMinimizerPlugin<T = CssNanoOptionsExtended> {
* @param {BasePluginOptions & DefinedDefaultMinimizerAndOptions<T>} [options]
*/
constructor(
options?:
| (BasePluginOptions & DefinedDefaultMinimizerAndOptions<T>)
| undefined,
options?: BasePluginOptions & DefinedDefaultMinimizerAndOptions<T>,
);
/**
* @private
Expand Down
28 changes: 14 additions & 14 deletions types/utils.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ export function memoize<T>(fn: (() => any) | undefined): () => T;
*/
export function cssnanoMinify(
input: Input,
sourceMap?: import("@jridgewell/trace-mapping").EncodedSourceMap | undefined,
minimizerOptions?: import("./index.js").CustomOptions | undefined,
sourceMap?: RawSourceMap,
minimizerOptions?: CustomOptions,
): Promise<MinimizedResult>;
export namespace cssnanoMinify {
function supportsWorkerThreads(): boolean;
Expand All @@ -45,8 +45,8 @@ export namespace cssnanoMinify {
*/
export function cssoMinify(
input: Input,
sourceMap?: import("@jridgewell/trace-mapping").EncodedSourceMap | undefined,
minimizerOptions?: import("./index.js").CustomOptions | undefined,
sourceMap?: RawSourceMap,
minimizerOptions?: CustomOptions,
): Promise<MinimizedResult>;
export namespace cssoMinify {
function supportsWorkerThreads(): boolean;
Expand All @@ -59,8 +59,8 @@ export namespace cssoMinify {
*/
export function cleanCssMinify(
input: Input,
sourceMap?: import("@jridgewell/trace-mapping").EncodedSourceMap | undefined,
minimizerOptions?: import("./index.js").CustomOptions | undefined,
sourceMap?: RawSourceMap,
minimizerOptions?: CustomOptions,
): Promise<MinimizedResult>;
export namespace cleanCssMinify {
function supportsWorkerThreads(): boolean;
Expand All @@ -73,8 +73,8 @@ export namespace cleanCssMinify {
*/
export function esbuildMinify(
input: Input,
sourceMap?: import("@jridgewell/trace-mapping").EncodedSourceMap | undefined,
minimizerOptions?: import("./index.js").CustomOptions | undefined,
sourceMap?: RawSourceMap,
minimizerOptions?: CustomOptions,
): Promise<MinimizedResult>;
export namespace esbuildMinify {
function supportsWorkerThreads(): boolean;
Expand All @@ -87,8 +87,8 @@ export namespace esbuildMinify {
*/
export function parcelCssMinify(
input: Input,
sourceMap?: import("@jridgewell/trace-mapping").EncodedSourceMap | undefined,
minimizerOptions?: import("./index.js").CustomOptions | undefined,
sourceMap?: RawSourceMap,
minimizerOptions?: CustomOptions,
): Promise<MinimizedResult>;
export namespace parcelCssMinify {
function supportsWorkerThreads(): boolean;
Expand All @@ -101,8 +101,8 @@ export namespace parcelCssMinify {
*/
export function lightningCssMinify(
input: Input,
sourceMap?: import("@jridgewell/trace-mapping").EncodedSourceMap | undefined,
minimizerOptions?: import("./index.js").CustomOptions | undefined,
sourceMap?: RawSourceMap,
minimizerOptions?: CustomOptions,
): Promise<MinimizedResult>;
export namespace lightningCssMinify {
function supportsWorkerThreads(): boolean;
Expand All @@ -115,8 +115,8 @@ export namespace lightningCssMinify {
*/
export function swcMinify(
input: Input,
sourceMap?: import("@jridgewell/trace-mapping").EncodedSourceMap | undefined,
minimizerOptions?: import("./index.js").CustomOptions | undefined,
sourceMap?: RawSourceMap,
minimizerOptions?: CustomOptions,
): Promise<MinimizedResult>;
export namespace swcMinify {
function supportsWorkerThreads(): boolean;
Expand Down
Loading