From c67d4c2839228276216cbc15de5fbf4ee6dff5ec Mon Sep 17 00:00:00 2001 From: harpsealjs Date: Wed, 11 Sep 2024 15:49:26 +0800 Subject: [PATCH] test(dev-server): enable dev server test cases (#7861) --- packages/rspack-dev-server/jest.config.js | 27 +++++++++++------------ packages/rspack-dev-server/package.json | 3 ++- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/rspack-dev-server/jest.config.js b/packages/rspack-dev-server/jest.config.js index 9999c192490..acb4b7b6a8b 100644 --- a/packages/rspack-dev-server/jest.config.js +++ b/packages/rspack-dev-server/jest.config.js @@ -8,21 +8,20 @@ const config = { }, testMatch: [ "/tests/*.test.ts", - ...(isWin || process.env.CI ? [] : ["/tests/e2e/*.test.js"]) + ...(isWin ? [] : ["/tests/e2e/*.test.js"]) ], - testPathIgnorePatterns: - isWin || process.env.CI - ? [] - : [ - // TODO: check why http proxy server throw error with websocket server - "/tests/e2e/allowed-hosts.test.js", - // TODO: check why this test timeout - "/tests/e2e/host.test.js", - // TODO: not support progress plugin event yet - "/tests/e2e/progress.test.js", - // TODO: check why this test throw error when run with other tests - "/tests/e2e/watch-files.test.js" - ], + testPathIgnorePatterns: isWin + ? [] + : [ + // TODO: check why http proxy server throw error with websocket server + "/tests/e2e/allowed-hosts.test.js", + // TODO: check why this test timeout + "/tests/e2e/host.test.js", + // TODO: not support progress plugin event yet + "/tests/e2e/progress.test.js", + // TODO: check why this test throw error when run with other tests + "/tests/e2e/watch-files.test.js" + ], cache: false, testTimeout: process.env.CI ? 120000 : 30000, transform: { diff --git a/packages/rspack-dev-server/package.json b/packages/rspack-dev-server/package.json index 3060392f170..db4c38aa4ff 100644 --- a/packages/rspack-dev-server/package.json +++ b/packages/rspack-dev-server/package.json @@ -20,7 +20,8 @@ "scripts": { "build": "tsc -b ./tsconfig.build.json", "dev": "tsc -w -b ./tsconfig.build.json", - "test": "rimraf .test-temp && cross-env NO_COLOR=1 node --expose-gc --max-old-space-size=8192 --experimental-vm-modules ../../node_modules/jest-cli/bin/jest --colors", + "test:install": "cross-env ./node_modules/.bin/puppeteer browsers install chrome", + "test": "pnpm run test:install && cross-env NO_COLOR=1 node --expose-gc --max-old-space-size=8192 --experimental-vm-modules ../../node_modules/jest-cli/bin/jest --colors", "api-extractor": "api-extractor run --verbose", "api-extractor:ci": "api-extractor run --verbose || diff temp/api.md etc/api.md" },