Skip to content
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

chore: more total cases #5569

Merged
merged 1 commit into from
Feb 1, 2024
Merged
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
62 changes: 31 additions & 31 deletions webpack-test/Stats.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,37 +20,37 @@ const compile = options => {
};

describe("Stats", () => {
// it("should print env string in stats", async () => {
// const stats = await compile({
// context: __dirname,
// entry: "./fixtures/a"
// });
// expect(
// stats.toString({
// all: false,
// env: true,
// _env: "production"
// })
// ).toBe('Environment (--env): "production"');
// expect(
// stats.toString({
// all: false,
// env: true,
// _env: {
// prod: ["foo", "bar"],
// baz: true
// }
// })
// ).toBe(
// "Environment (--env): {\n" +
// ' "prod": [\n' +
// ' "foo",\n' +
// ' "bar"\n' +
// " ],\n" +
// ' "baz": true\n' +
// "}"
// );
// });
it("should print env string in stats", async () => {
const stats = await compile({
context: __dirname,
entry: "./fixtures/a"
});
expect(
stats.toString({
all: false,
env: true,
_env: "production"
})
).toBe('Environment (--env): "production"');
expect(
stats.toString({
all: false,
env: true,
_env: {
prod: ["foo", "bar"],
baz: true
}
})
).toBe(
"Environment (--env): {\n" +
' "prod": [\n' +
' "foo",\n' +
' "bar"\n' +
" ],\n" +
' "baz": true\n' +
"}"
);
});
it("should omit all properties with all false", async () => {
const stats = await compile({
context: __dirname,
Expand Down
3 changes: 1 addition & 2 deletions webpack-test/TestCasesHot.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const webpack = require("@rspack/core");
describe("TestCases", () => {
describeCases({
name: "hot",
// TODO: recover this line after we have this js plugin
// plugins: [new webpack.HotModuleReplacementPlugin()]
plugins: [new webpack.HotModuleReplacementPlugin()]
});
});
96 changes: 93 additions & 3 deletions webpack-test/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,103 @@ module.exports = {
"<rootDir>/setupTestFramework.js"
],
"testMatch": [
// "<rootDir>/AbstractMethodError.unittest.js",
// "<rootDir>/ArrayHelpers.unittest.js",
// "<rootDir>/BannerPlugin.test.js",
// "<rootDir>/BinaryMiddleware.unittest.js",
// "<rootDir>/BuildDependencies.longtest.js",
// "<rootDir>/ChangesAndRemovals.test.js",
// "<rootDir>/Chunk.unittest.js",
// "<rootDir>/Cli.basictest.js",
// "<rootDir>/Compiler-caching.test.js",
// "<rootDir>/Compiler.test.js",
// "<rootDir>/ConfigCacheTestCases.longtest.js",
"<rootDir>/ConfigTestCases.basictest.js",
// "<rootDir>/ContextModule.unittest.js",
// "<rootDir>/ContextModuleFactory.unittest.js",
// "<rootDir>/Defaults.unittest.js",
// "<rootDir>/Errors.test.js",
"<rootDir>/Examples.test.js",
// "<rootDir>/FileSystemInfo.unittest.js",
// "<rootDir>/HotModuleReplacementPlugin.test.js",
"<rootDir>/HotTestCasesAsyncNode.test.js",
"<rootDir>/HotTestCasesNode.test.js",
"<rootDir>/HotTestCasesWeb.test.js",
"<rootDir>/HotTestCasesWebWorker.test.js",
// "<rootDir>/JavascriptParser.unittest.js",
// "<rootDir>/LazySet.unittest.js",
// "<rootDir>/LocalModulesHelpers.unittest.js",
// "<rootDir>/MemoryLimitTestCases.test.js",
// "<rootDir>/ModuleDependencyError.unittest.js",
// "<rootDir>/MultiCompiler.test.js",
// "<rootDir>/MultiItemCache.unittest.js",
"<rootDir>/MultiStats.test.js",
// "<rootDir>/MultiWatching.unittest.js",
// "<rootDir>/NodeTemplatePlugin.test.js",
// "<rootDir>/NormalModule.unittest.js",
// "<rootDir>/NullDependency.unittest.js",
// "<rootDir>/PersistentCaching.test.js",
// "<rootDir>/ProfilingPlugin.test.js",
// "<rootDir>/ProfilingPlugin.unittest.js",
// "<rootDir>/ProgressPlugin.test.js",
// "<rootDir>/RawModule.unittest.js",
// "<rootDir>/RequestShortener.unittest.js",
// "<rootDir>/RuntimeTemplate.unittest.js",
// "<rootDir>/SemVer.unittest.js",
// "<rootDir>/SideEffectsFlagPlugin.unittest.js",
// "<rootDir>/SizeFormatHelpers.unittest.js",
// "<rootDir>/SortableSet.unittest.js",
// "<rootDir>/Stats.test.js",
"<rootDir>/StatsTestCases.basictest.js",
// "<rootDir>/Template.unittest.js",
// "<rootDir>/TestCasesAllCombined.longtest.js",
// "<rootDir>/TestCasesCachePack.longtest.js",
// "<rootDir>/TestCasesDevelopment.test.js",
// "<rootDir>/TestCasesDevtoolCheapSourceMap.test.js",
// "<rootDir>/TestCasesDevtoolEval.test.js",
// "<rootDir>/TestCasesDevtoolEvalCheapModuleSourceMap.test.js",
// "<rootDir>/TestCasesDevtoolEvalCheapSourceMap.test.js",
// "<rootDir>/TestCasesDevtoolEvalDeterministicModuleIds.test.js",
// "<rootDir>/TestCasesDevtoolEvalNamedModules.test.js",
// "<rootDir>/TestCasesDevtoolEvalSourceMap.test.js",
// "<rootDir>/TestCasesDevtoolInlineCheapSourceMap.test.js",
// "<rootDir>/TestCasesDevtoolInlineSourceMap.longtest.js",
// "<rootDir>/TestCasesDevtoolSourceMap.longtest.js",
"<rootDir>/TestCasesHot.test.js",
// "<rootDir>/TestCasesMinimizedSourceMap.longtest.js",
// "<rootDir>/TestCasesModule.test.js",
"<rootDir>/TestCasesNormal.basictest.js",
// "<rootDir>/TestCasesProdGlobalUsed.test.js",
// "<rootDir>/TestCasesProduction.longtest.js",
// "<rootDir>/URLAbsoluteSpecifier.unittest.js",
// "<rootDir>/Validation.test.js",
// "<rootDir>/WasmHashes.unittest.js",
// "<rootDir>/Watch.test.js",
// "<rootDir>/WatchCacheUnaffectedTestCases.longtest.js",
// "<rootDir>/WatchClose.test.js",
// "<rootDir>/WatchDetection.test.js",
// "<rootDir>/WatchSuspend.test.js",
"<rootDir>/WatchTestCases.longtest.js",
// "<rootDir>/WatcherEvents.test.js",
// "<rootDir>/WebpackError.unittest.js",
// "<rootDir>/cleverMerge.unittest.js",
// "<rootDir>/compareLocations.unittest.js",
// "<rootDir>/compileBooleanMatcher.unittest.js",
// "<rootDir>/deterministicGrouping.unittest.js",
// "<rootDir>/extractUrlAndGlobal.unittest.js",
// "<rootDir>/formatLocation.unittest.js",
// "<rootDir>/identifier.unittest.js",
// "<rootDir>/nonNumericOnlyHash.unittest.js",
// "<rootDir>/numberHash.unittest.js",
// "<rootDir>/objectToMap.unittest.js",
// "<rootDir>/smartGrouping.unittest.js",
// "<rootDir>/target-browserslist.unittest.js",
// "<rootDir>/walkCssTokens.unittest.js",

// "<rootDir>/*.test.js",
// "<rootDir>/*.basictest.js",
// "<rootDir>/*.longtest.js",
// "<rootDir>/*.unittest.js",
"<rootDir>/Examples.test.js",
"<rootDir>/TestCasesNormal.basictest.js",
"<rootDir>/ConfigTestCases.basictest.js"
],
"watchPathIgnorePatterns": [
"<rootDir>/.git",
Expand Down
Loading