Skip to content

Commit

Permalink
feat: skip more test case
Browse files Browse the repository at this point in the history
  • Loading branch information
IWANABETHATGUY committed Apr 11, 2023
1 parent 71db15c commit a56f78c
Showing 31 changed files with 143 additions and 143 deletions.
5 changes: 3 additions & 2 deletions webpack-test/ArrayHelpers.unittest.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"use strict";

const ArrayHelpers = require("../lib/util/ArrayHelpers");
// TODO: recover after we have this module
// const ArrayHelpers = require("../lib/util/ArrayHelpers");

describe("ArrayHelpers", () => {
describe.skip("ArrayHelpers", () => {
it("groupBy should partition into two arrays", () => {
expect(
ArrayHelpers.groupBy([1, 2, 3, 4, 5, 6], x => x % 2 === 0)
9 changes: 5 additions & 4 deletions webpack-test/BannerPlugin.test.js
Original file line number Diff line number Diff line change
@@ -5,10 +5,11 @@ const fs = require("graceful-fs");

const webpack = require("@rspack/core").rspack;

const pluginDir = path.join(__dirname, "js", "BannerPlugin");
const outputDir = path.join(pluginDir, "output");
// TODO: recover after we have this module
// const pluginDir = path.join(__dirname, "js", "BannerPlugin");
// const outputDir = path.join(pluginDir, "output");

it("should cache assets", done => {
it.skip("should cache assets", done => {
const entry1File = path.join(pluginDir, "entry1.js");
const entry2File = path.join(pluginDir, "entry2.js");
const outputFile = path.join(outputDir, "entry1.js");
@@ -46,7 +47,7 @@ it("should cache assets", done => {
});
});

it("can place banner as footer", done => {
it.skip("can place banner as footer", done => {
const footerFile = path.join(pluginDir, "footerFile.js");
const outputFile = path.join(outputDir, "footerFile.js");
try {
50 changes: 25 additions & 25 deletions webpack-test/BinaryMiddleware.unittest.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
const BinaryMiddleware = require("../lib/serialization/BinaryMiddleware");
const SerializerMiddleware = require("../lib/serialization/SerializerMiddleware");
// TODO: recover after we have this module
// const BinaryMiddleware = require("../lib/serialization/BinaryMiddleware");
// const SerializerMiddleware = require("../lib/serialization/SerializerMiddleware");

const cont = (base, count) => {
const result = [];
for (let i = 0; i < count; i++) {
result.push(base[i % base.length]);
}
return result;
};

const mw = new BinaryMiddleware();
const other = { other: true };

const resolveLazy = item => {
if (SerializerMiddleware.isLazy(item)) {
const data = item();
if (Array.isArray(data)) return { resolvesTo: data.map(resolveLazy) };
return { resolvesTo: resolveLazy(data) };
}
return item;
};
// const cont = (base, count) => {
// const result = [];
// for (let i = 0; i < count; i++) {
// result.push(base[i % base.length]);
// }
// return result;
// };
//
// const mw = new BinaryMiddleware();
// const other = { other: true };
//
// const resolveLazy = item => {
// if (SerializerMiddleware.isLazy(item)) {
// const data = item();
// if (Array.isArray(data)) return { resolvesTo: data.map(resolveLazy) };
// return { resolvesTo: resolveLazy(data) };
// }
// return item;
// };

describe("BinaryMiddleware", () => {
describe("BinaryMiddleware", () => {
it("filtered", () => {})
})
describe.skip("BinaryMiddleware", () => {
it("filtered", () => {})
return
const items = [
true,
false,
2 changes: 1 addition & 1 deletion webpack-test/BuildDependencies.longtest.js
Original file line number Diff line number Diff line change
@@ -97,7 +97,7 @@ const exec = (n, options = {}) => {

const supportsEsm = +process.versions.modules >= 83;

describe("BuildDependencies", () => {
describe.skip("BuildDependencies", () => {
beforeEach(done => {
rimraf(cacheDirectory, done);
});
5 changes: 3 additions & 2 deletions webpack-test/Chunk.unittest.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"use strict";

const Chunk = require("../lib/Chunk");
// TODO: recover after we have this module
// const Chunk = require("../lib/Chunk");

describe("Chunk", () => {
describe.skip("Chunk", () => {
let ChunkInstance;

beforeEach(() => {
5 changes: 3 additions & 2 deletions webpack-test/Cli.basictest.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const { getArguments, processArguments } = require("../").cli;
// TODO: recover after we have this module
// const { getArguments, processArguments } = require("../").cli;

describe("Cli", () => {
describe.skip("Cli", () => {
it("should generate the correct cli flags", () => {
expect(getArguments()).toMatchSnapshot();
});
7 changes: 4 additions & 3 deletions webpack-test/Compiler-caching.test.js
Original file line number Diff line number Diff line change
@@ -8,12 +8,13 @@ const rimraf = require("rimraf");

let fixtureCount = 0;

describe("Compiler (caching)", () => {
describe.skip("Compiler (caching)", () => {
jest.setTimeout(15000);

function compile(entry, options, callback) {
const webpack = require("@rspack/core").rspack;
options = webpack.config.getNormalizedWebpackOptions(options);
const rspack = require("@rspack/core");
const webpack = rspack.rspack // compatible with webpack test, used as a constructor
options = rspack.getNormalizedRspackOptions(options);
options.mode = "none";
options.cache = true;
options.entry = entry;
13 changes: 7 additions & 6 deletions webpack-test/Compiler.test.js
Original file line number Diff line number Diff line change
@@ -2,13 +2,14 @@

// require("./helpers/warmup-webpack");

const path = require("path");
const Stats = require("../lib/Stats");
const { createFsFromVolume, Volume } = require("memfs");
const captureStdio = require("./helpers/captureStdio");
const deprecationTracking = require("./helpers/deprecationTracking");
// TODO: recover after we have these module
// const path = require("path");
// const Stats = require("../lib/Stats");
// const { createFsFromVolume, Volume } = require("memfs");
// const captureStdio = require("./helpers/captureStdio");
// const deprecationTracking = require("./helpers/deprecationTracking");

describe("Compiler", () => {
describe.skip("Compiler", () => {
jest.setTimeout(20000);
function compile(entry, options, callback) {
const noOutputPath = !options.output || !options.output.path;
8 changes: 3 additions & 5 deletions webpack-test/ContextModule.unittest.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
"use strict";

const ContextModule = require("../lib/ContextModule");
// TODO: recover after we have this module
// const ContextModule = require("../lib/ContextModule");

describe("contextModule", () => {
describe.skip("contextModule", ()=> {
it("filtered", () => {})
})
describe.skip("contextModule", () => {
let contextModule;
let request;
beforeEach(() => {
6 changes: 3 additions & 3 deletions webpack-test/ContextModuleFactory.unittest.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"use strict";

const { createFsFromVolume, Volume } = require("memfs");
const ContextModuleFactory = require("../lib/ContextModuleFactory");
// const { createFsFromVolume, Volume } = require("memfs");
// const ContextModuleFactory = require("../lib/ContextModuleFactory");

describe("ContextModuleFactory", () => {
describe.skip("ContextModuleFactory", () => {
describe("resolveDependencies", () => {
let factory, memfs;
beforeEach(() => {
11 changes: 5 additions & 6 deletions webpack-test/Defaults.unittest.js
Original file line number Diff line number Diff line change
@@ -62,15 +62,14 @@ expect.addSnapshotSerializer({
});

const getDefaultConfig = config => {
const { applyWebpackOptionsDefaults, getNormalizedWebpackOptions } =
require("@rspack/core").rspack.config;
config = getNormalizedWebpackOptions(config);
applyWebpackOptionsDefaults(config);
const { applyRspackOptionsDefaults, getNormalizedRspackOptions } = require("@rspack/core");
config = getNormalizedRspackOptions(config);
applyRspackOptionsDefaults(config);
process.chdir(cwd);
return config;
};

describe("snapshots", () => {
describe.skip("snapshots", () => {
const baseConfig = getDefaultConfig({ mode: "none" });

it("should have the correct base config", () => {
@@ -2301,7 +2300,7 @@ describe("snapshots", () => {
);
});

it("should result in the same target options for same target", () => {
it.skip("should result in the same target options for same target", () => {
const inlineTarget = getDefaultConfig({ target: "node12.17" });
const browserslistTarget = getDefaultConfig({
target: "browserslist: node 12.17"
33 changes: 17 additions & 16 deletions webpack-test/Errors.test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"use strict";

require("./helpers/warmup-webpack");
// require("./helpers/warmup-webpack");

const path = require("path");
const fs = require("graceful-fs");
const webpack = require("@rspack/core");
const webpack = require("@rspack/core").rspack;
const prettyFormat = require("pretty-format").default;

const CWD_PATTERN = new RegExp(process.cwd().replace(/\\/g, "/"), "gm");
@@ -51,8 +51,7 @@ const prettyFormatOptions = {
]
};

expect.addSnapshotSerializer({
test(received) {
expect.addSnapshotSerializer({ test(received) {
return received.errors || received.warnings;
},
print(received) {
@@ -131,7 +130,7 @@ async function compile(options) {
return { errors, warnings };
}

it("should emit warning for missingFile", async () => {
it.skip("should emit warning for missingFile", async () => {
await expect(
compile({
entry: "./missingFile"
@@ -163,7 +162,7 @@ it("should emit warning for missingFile", async () => {
`);
}, 20000);

it("should emit warning for require.extensions", async () => {
it.skip("should emit warning for require.extensions", async () => {
await expect(compile({ entry: "./require.extensions" })).resolves
.toMatchInlineSnapshot(`
Object {
@@ -183,7 +182,7 @@ it("should emit warning for require.extensions", async () => {
`);
});

it("should emit warning for require.main.require", async () => {
it.skip("should emit warning for require.main.require", async () => {
await expect(compile({ entry: "./require.main.require" })).resolves
.toMatchInlineSnapshot(`
Object {
@@ -202,7 +201,7 @@ it("should emit warning for require.main.require", async () => {
}
`);
});
it("should emit warning for module.parent.require", async () => {
it.skip("should emit warning for module.parent.require", async () => {
await expect(compile({ entry: "./module.parent.require" })).resolves
.toMatchInlineSnapshot(`
Object {
@@ -226,7 +225,8 @@ const isCaseInsensitiveFilesystem = fs.existsSync(
path.resolve(__dirname, "fixtures", "errors", "FILE.js")
);
if (isCaseInsensitiveFilesystem) {
it("should emit warning for case-preserved disk", async () => {
it.skip("should emit warning for case-preserved disk", async () => {
it.skip("filtered", () => {})
const result = await compile({
mode: "development",
entry: "./case-sensitive"
@@ -262,7 +262,7 @@ if (isCaseInsensitiveFilesystem) {
`);
});
} else {
it("should emit error for case-sensitive", async () => {
it.skip("should emit error for case-sensitive", async () => {
const result = await compile({
mode: "development",
entry: "./case-sensitive"
@@ -286,7 +286,7 @@ if (isCaseInsensitiveFilesystem) {
});
}

it("should emit warning for undef mode", async () => {
it.skip("should emit warning for undef mode", async () => {
await expect(compile({ mode: undefined, entry: "./entry-point" })).resolves
.toMatchInlineSnapshot(`
Object {
@@ -300,7 +300,7 @@ it("should emit warning for undef mode", async () => {
}
`);
});
it("should emit no errors or warnings for no-errors-deprecate", async () => {
it.skip("should emit no errors or warnings for no-errors-deprecate", async () => {
await expect(compile({ mode: "production", entry: "./no-errors-deprecate" }))
.resolves.toMatchInlineSnapshot(`
Object {
@@ -310,7 +310,7 @@ it("should emit no errors or warnings for no-errors-deprecate", async () => {
`);
});

it("should emit errors for missingFile for production", async () => {
it.skip("should emit errors for missingFile for production", async () => {
await expect(compile({ mode: "production", entry: "./missingFile" })).resolves
.toMatchInlineSnapshot(`
Object {
@@ -339,7 +339,7 @@ it("should emit errors for missingFile for production", async () => {
`);
});

it("should emit module build errors", async () => {
it.skip("should emit module build errors", async () => {
await expect(compile({ entry: "./has-syntax-error" })).resolves
.toMatchInlineSnapshot(`
Object {
@@ -359,7 +359,7 @@ it("should emit module build errors", async () => {
`);
});

it("should bao; thrown sync error from plugin", async () => {
it.skip("should bao; thrown sync error from plugin", async () => {
await expect(
compile({
entry: "./no-errors-deprecate",
@@ -373,7 +373,8 @@ it("should bao; thrown sync error from plugin", async () => {
`);
});

describe("loaders", () => {
describe.skip("loaders", () => {

it("should emit error thrown at module level", async () => {
await expect(
compile({
11 changes: 6 additions & 5 deletions webpack-test/FileSystemInfo.unittest.js
Original file line number Diff line number Diff line change
@@ -2,10 +2,11 @@

const { createFsFromVolume, Volume } = require("memfs");
const util = require("util");
const FileSystemInfo = require("../lib/FileSystemInfo");
const { buffersSerializer } = require("../lib/util/serialization");
// TODO: recover after we have this module
// const FileSystemInfo = require("../lib/FileSystemInfo");
// const { buffersSerializer } = require("../lib/util/serialization");

describe("FileSystemInfo", () => {
describe.skip("FileSystemInfo", () => {
const files = [
"/path/file.txt",
"/path/nested/deep/file.txt",
@@ -238,7 +239,7 @@ ${details(snapshot)}`)
["hash", { hash: true }],
["tsh", { timestamp: true, hash: true }]
]) {
describe(`${name} mode`, () => {
describe.skip(`${name} mode`, () => {
it("should always accept an empty snapshot", done => {
const fs = createFs();
const fsInfo = createFsInfo(fs);
@@ -364,7 +365,7 @@ ${details(snapshot)}`)
});
}

describe("stable iterables identity", () => {
describe.skip("stable iterables identity", () => {
const options = { timestamp: true };

/**
2 changes: 1 addition & 1 deletion webpack-test/HotModuleReplacementPlugin.test.js
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ const fs = require("graceful-fs");

const webpack = require("@rspack/core").rspack;

describe("HotModuleReplacementPlugin", () => {
describe.skip("HotModuleReplacementPlugin", () => {
jest.setTimeout(20000);
it("should not have circular hashes but equal if unmodified", done => {
const entryFile = path.join(
Loading

0 comments on commit a56f78c

Please sign in to comment.