Skip to content

Commit

Permalink
chore: fix tests on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed Aug 4, 2024
1 parent 9e470b5 commit 9998d51
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"test:coverage": "npm run test:only -- --coverage",
"test:watch": "npm run test:coverage --watch",
"test": "npm run test:coverage",
"test:e2e": "npx playwright test",
"test:e2e": "playwright test",
"pretest": "npm run lint",
"prepare": "husky && npm run build",
"release": "standard-version"
Expand Down
3 changes: 0 additions & 3 deletions playwright.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ module.exports = {
name: "chromium",
use: {
browserName: "chromium",
launchOptions: {
args: ["--ignore-certificate-errors"],
},
},
},
],
Expand Down
4 changes: 4 additions & 0 deletions test/e2e/server.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,10 @@ test.describe("server option", () => {
});

test.describe("as object", () => {
// TODO: This test is skipped because it fails on Windows, should be fixed in the future
if (process.platform !== "win32") {
return;
}
test.describe("ca, pfx, key and cert are array of buffers", () => {
let compiler;
let server;
Expand Down
4 changes: 2 additions & 2 deletions test/helpers/playwright-test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict";

const { test, mergeTests } = require("@playwright/test");
const { test } = require("@playwright/test");

Check failure on line 3 in test/helpers/playwright-test.js

View workflow job for this annotation

GitHub Actions / Test - macos-latest - Node v20.x, Webpack latest (1/4)

[chromium] › app.test.js:59:9 › app option › should work using "express" application and "http" server › should handle GET request to index route (/)

2) [chromium] › app.test.js:59:9 › app option › should work using "express" application and "http" server › should handle GET request to index route (/) Error: Requiring @playwright/test second time, First: Error: at ../helpers/playwright-test.js:3 1 | "use strict"; 2 | > 3 | const { test } = require("@playwright/test"); | ^ 4 | 5 | const customTest = test.extend({ 6 | done: [ at Object.<anonymous> (/Users/runner/work/webpack-dev-server/webpack-dev-server/node_modules/playwright/lib/index.js:69:33) at Module._compile (node:internal/modules/cjs/loader:1358:14) at Module._extensions..js (node:internal/modules/cjs/loader:1416:10) at Object.i.<computed>.ut._extensions.<computed> [as .js] (/Users/runner/work/webpack-dev-server/webpack-dev-server/node_modules/playwright/lib/utilsBundleImpl.js:16:1010) at Module.load (node:internal/modules/cjs/loader:1208:32) at Function.Module._load (node:internal/modules/cjs/loader:1024:12) at Module.require (node:internal/modules/cjs/loader:1233:19) at require (node:internal/modules/helpers:179:18) at Object.<anonymous> (/Users/runner/work/webpack-dev-server/webpack-dev-server/node_modules/playwright/test.js:17:13) at Module._compile (node:internal/modules/cjs/loader:1358:14) at Module._extensions..js (node:internal/modules/cjs/loader:1416:10) at Object.i.<computed>.ut._extensions.<computed> [as .js] (/Users/runner/work/webpack-dev-server/webpack-dev-server/node_modules/playwright/lib/utilsBundleImpl.js:16:1010) at Module.load (node:internal/modules/cjs/loader:1208:32) at Function.Module._load (node:internal/modules/cjs/loader:1024:12) at Module.require (node:internal/modules/cjs/loader:1233:19) at require (node:internal/modules/helpers:179:18) at Object.<anonymous> (/Users/runner/work/webpack-dev-server/webpack-dev-server/node_modules/@playwright/test/index.js:17:18) at Module._compile (node:internal/modules/cjs/loader:1358:14) at Module._extensions..js (node:internal/modules/cjs/loader:1416:10) at Object.i.<computed>.ut._extensions.<computed> [as .js] (/Users/runner/work/webpack-dev-server/webpack-dev-server/node_modules/playwright/lib/utilsBundleImpl.js:16:1010) at Module.load (node:internal/modules/cjs/loader:1208:32) at Function.Module._load (node:internal/modules/cjs/loader:1024:12) at Module.require (node:internal/modules/cjs/loader:1233:19) at require (node:internal/modules/helpers:179:18) at Object.<anonymous> (/Users/runner/work/webpack-dev-server/webpack-dev-server/test/helpers/playwright-test.js:3:18) at Module._compile (node:internal/modules/cjs/loader:1358:14) at Module.f._compile (/Users/runner/work/webpack-dev-server/webpack-dev-server/node_modules/playwright/lib/utilsBundleImpl.js:16:994) at Module._extensions..js (node:internal/modules/cjs/loader:1416:10) at Object.i.<computed>.ut._extensions.<computed> [as .js] (/Users/runner/work/webpack-dev-server/webpack-dev-server/node_modules/playwright/lib/utilsBundleImpl.js:16:1010) at Module.load (node:internal/modules/cjs/loader:1208:32) at Function.Module._load (node:internal/modules/cjs/loader:1024:12) at Module.require (node:internal/modules/cjs/loader:1233:19) at require (node:internal/modules/helpers:179:18) at Object.<anonymous> (/Users/runner/work/webpack-dev-server/webpack-dev-server/test/e2e/api.test.js:6:18) at Module._compile (node:internal/modules/cjs/loader:1358:14) at Module.f._compile (/Users/runner/work/webpack-dev-server/webpack-dev-server/node_modules/playwright/lib/utilsBundleImpl.js:16:994) at Module._extensions..js (node:internal/modules/cjs/loader:1416:10) at Object.i.<computed>.ut._extensions.<computed> [as .js] (/Users/runner/work/webpack-dev-server/webpack-dev-server/node_modules/playwright/lib/utilsBundleImpl.js:16:1010)

Check failure on line 3 in test/helpers/playwright-test.js

View workflow job for this annotation

GitHub Actions / Test - macos-latest - Node v18.x, Webpack latest (1/4)

[chromium] › app.test.js:59:9 › app option › should work using "express" application and "http" server › should handle GET request to index route (/)

2) [chromium] › app.test.js:59:9 › app option › should work using "express" application and "http" server › should handle GET request to index route (/) Error: Requiring @playwright/test second time, First: Error: at ../helpers/playwright-test.js:3 1 | "use strict"; 2 | > 3 | const { test } = require("@playwright/test"); | ^ 4 | 5 | const customTest = test.extend({ 6 | done: [ at Object.<anonymous> (/Users/runner/work/webpack-dev-server/webpack-dev-server/node_modules/playwright/lib/index.js:69:33) at Module._compile (node:internal/modules/cjs/loader:1364:14) at Module._extensions..js (node:internal/modules/cjs/loader:1422:10) at Object.i.<computed>.ut._extensions.<computed> [as .js] (/Users/runner/work/webpack-dev-server/webpack-dev-server/node_modules/playwright/lib/utilsBundleImpl.js:16:1010) at Module.load (node:internal/modules/cjs/loader:1203:32) at Function.Module._load (node:internal/modules/cjs/loader:1019:12) at Module.require (node:internal/modules/cjs/loader:1231:19) at require (node:internal/modules/helpers:177:18) at Object.<anonymous> (/Users/runner/work/webpack-dev-server/webpack-dev-server/node_modules/playwright/test.js:17:13) at Module._compile (node:internal/modules/cjs/loader:1364:14) at Module._extensions..js (node:internal/modules/cjs/loader:1422:10) at Object.i.<computed>.ut._extensions.<computed> [as .js] (/Users/runner/work/webpack-dev-server/webpack-dev-server/node_modules/playwright/lib/utilsBundleImpl.js:16:1010) at Module.load (node:internal/modules/cjs/loader:1203:32) at Function.Module._load (node:internal/modules/cjs/loader:1019:12) at Module.require (node:internal/modules/cjs/loader:1231:19) at require (node:internal/modules/helpers:177:18) at Object.<anonymous> (/Users/runner/work/webpack-dev-server/webpack-dev-server/node_modules/@playwright/test/index.js:17:18) at Module._compile (node:internal/modules/cjs/loader:1364:14) at Module._extensions..js (node:internal/modules/cjs/loader:1422:10) at Object.i.<computed>.ut._extensions.<computed> [as .js] (/Users/runner/work/webpack-dev-server/webpack-dev-server/node_modules/playwright/lib/utilsBundleImpl.js:16:1010) at Module.load (node:internal/modules/cjs/loader:1203:32) at Function.Module._load (node:internal/modules/cjs/loader:1019:12) at Module.require (node:internal/modules/cjs/loader:1231:19) at require (node:internal/modules/helpers:177:18) at Object.<anonymous> (/Users/runner/work/webpack-dev-server/webpack-dev-server/test/helpers/playwright-test.js:3:18) at Module._compile (node:internal/modules/cjs/loader:1364:14) at Module.f._compile (/Users/runner/work/webpack-dev-server/webpack-dev-server/node_modules/playwright/lib/utilsBundleImpl.js:16:994) at Module._extensions..js (node:internal/modules/cjs/loader:1422:10) at Object.i.<computed>.ut._extensions.<computed> [as .js] (/Users/runner/work/webpack-dev-server/webpack-dev-server/node_modules/playwright/lib/utilsBundleImpl.js:16:1010) at Module.load (node:internal/modules/cjs/loader:1203:32) at Function.Module._load (node:internal/modules/cjs/loader:1019:12) at Module.require (node:internal/modules/cjs/loader:1231:19) at require (node:internal/modules/helpers:177:18) at Object.<anonymous> (/Users/runner/work/webpack-dev-server/webpack-dev-server/test/e2e/api.test.js:6:18) at Module._compile (node:internal/modules/cjs/loader:1364:14) at Module.f._compile (/Users/runner/work/webpack-dev-server/webpack-dev-server/node_modules/playwright/lib/utilsBundleImpl.js:16:994) at Module._extensions..js (node:internal/modules/cjs/loader:1422:10) at Object.i.<computed>.ut._extensions.<computed> [as .js] (/Users/runner/work/webpack-dev-server/webpack-dev-server/node_modules/playwright/lib/utilsBundleImpl.js:16:1010)

Check failure on line 3 in test/helpers/playwright-test.js

View workflow job for this annotation

GitHub Actions / Test - ubuntu-latest - Node v22.x, Webpack latest (1/4)

[chromium] › app.test.js:59:9 › app option › should work using "express" application and "http" server › should handle GET request to index route (/)

2) [chromium] › app.test.js:59:9 › app option › should work using "express" application and "http" server › should handle GET request to index route (/) Error: Requiring @playwright/test second time, First: Error: at ../helpers/playwright-test.js:3 1 | "use strict"; 2 | > 3 | const { test } = require("@playwright/test"); | ^ 4 | 5 | const customTest = test.extend({ 6 | done: [ at Object.<anonymous> (/home/runner/work/webpack-dev-server/webpack-dev-server/node_modules/playwright/lib/index.js:69:33) at Module._compile (node:internal/modules/cjs/loader:1504:14) at Module._extensions..js (node:internal/modules/cjs/loader:1588:10) at Object.i.<computed>.ut._extensions.<computed> [as .js] (/home/runner/work/webpack-dev-server/webpack-dev-server/node_modules/playwright/lib/utilsBundleImpl.js:16:1010) at Module.load (node:internal/modules/cjs/loader:1282:32) at Function.Module._load (node:internal/modules/cjs/loader:1098:12) at TracingChannel.traceSync (node:diagnostics_channel:315:14) at wrapModuleLoad (node:internal/modules/cjs/loader:215:24) at Module.require (node:internal/modules/cjs/loader:1304:12) at require (node:internal/modules/helpers:123:16) at Object.<anonymous> (/home/runner/work/webpack-dev-server/webpack-dev-server/node_modules/playwright/test.js:17:13) at Module._compile (node:internal/modules/cjs/loader:1504:14) at Module._extensions..js (node:internal/modules/cjs/loader:1588:10) at Object.i.<computed>.ut._extensions.<computed> [as .js] (/home/runner/work/webpack-dev-server/webpack-dev-server/node_modules/playwright/lib/utilsBundleImpl.js:16:1010) at Module.load (node:internal/modules/cjs/loader:1282:32) at Function.Module._load (node:internal/modules/cjs/loader:1098:12) at TracingChannel.traceSync (node:diagnostics_channel:315:14) at wrapModuleLoad (node:internal/modules/cjs/loader:215:24) at Module.require (node:internal/modules/cjs/loader:1304:12) at require (node:internal/modules/helpers:123:16) at Object.<anonymous> (/home/runner/work/webpack-dev-server/webpack-dev-server/node_modules/@playwright/test/index.js:17:18) at Module._compile (node:internal/modules/cjs/loader:1504:14) at Module._extensions..js (node:internal/modules/cjs/loader:1588:10) at Object.i.<computed>.ut._extensions.<computed> [as .js] (/home/runner/work/webpack-dev-server/webpack-dev-server/node_modules/playwright/lib/utilsBundleImpl.js:16:1010) at Module.load (node:internal/modules/cjs/loader:1282:32) at Function.Module._load (node:internal/modules/cjs/loader:1098:12) at TracingChannel.traceSync (node:diagnostics_channel:315:14) at wrapModuleLoad (node:internal/modules/cjs/loader:215:24) at Module.require (node:internal/modules/cjs/loader:1304:12) at require (node:internal/modules/helpers:123:16) at Object.<anonymous> (/home/runner/work/webpack-dev-server/webpack-dev-server/test/helpers/playwright-test.js:3:18) at Module._compile (node:internal/modules/cjs/loader:1504:14) at Module.f._compile (/home/runner/work/webpack-dev-server/webpack-dev-server/node_modules/playwright/lib/utilsBundleImpl.js:16:994) at Module._extensions..js (node:internal/modules/cjs/loader:1588:10) at Object.i.<computed>.ut._extensions.<computed> [as .js] (/home/runner/work/webpack-dev-server/webpack-dev-server/node_modules/playwright/lib/utilsBundleImpl.js:16:1010) at Module.load (node:internal/modules/cjs/loader:1282:32) at Function.Module._load (node:internal/modules/cjs/loader:1098:12) at TracingChannel.traceSync (node:diagnostics_channel:315:14) at wrapModuleLoad (node:internal/modules/cjs/loader:215:24) at Module.require (node:internal/modules/cjs/loader:1304:12) at require (node:internal/modules/helpers:123:16) at Object.<anonymous> (/home/run

Check failure on line 3 in test/helpers/playwright-test.js

View workflow job for this annotation

GitHub Actions / Test - ubuntu-latest - Node v20.x, Webpack latest (1/4)

[chromium] › app.test.js:59:9 › app option › should work using "express" application and "http" server › should handle GET request to index route (/)

2) [chromium] › app.test.js:59:9 › app option › should work using "express" application and "http" server › should handle GET request to index route (/) Error: Requiring @playwright/test second time, First: Error: at ../helpers/playwright-test.js:3 1 | "use strict"; 2 | > 3 | const { test } = require("@playwright/test"); | ^ 4 | 5 | const customTest = test.extend({ 6 | done: [ at Object.<anonymous> (/home/runner/work/webpack-dev-server/webpack-dev-server/node_modules/playwright/lib/index.js:69:33) at Module._compile (node:internal/modules/cjs/loader:1358:14) at Module._extensions..js (node:internal/modules/cjs/loader:1416:10) at Object.i.<computed>.ut._extensions.<computed> [as .js] (/home/runner/work/webpack-dev-server/webpack-dev-server/node_modules/playwright/lib/utilsBundleImpl.js:16:1010) at Module.load (node:internal/modules/cjs/loader:1208:32) at Function.Module._load (node:internal/modules/cjs/loader:1024:12) at Module.require (node:internal/modules/cjs/loader:1233:19) at require (node:internal/modules/helpers:179:18) at Object.<anonymous> (/home/runner/work/webpack-dev-server/webpack-dev-server/node_modules/playwright/test.js:17:13) at Module._compile (node:internal/modules/cjs/loader:1358:14) at Module._extensions..js (node:internal/modules/cjs/loader:1416:10) at Object.i.<computed>.ut._extensions.<computed> [as .js] (/home/runner/work/webpack-dev-server/webpack-dev-server/node_modules/playwright/lib/utilsBundleImpl.js:16:1010) at Module.load (node:internal/modules/cjs/loader:1208:32) at Function.Module._load (node:internal/modules/cjs/loader:1024:12) at Module.require (node:internal/modules/cjs/loader:1233:19) at require (node:internal/modules/helpers:179:18) at Object.<anonymous> (/home/runner/work/webpack-dev-server/webpack-dev-server/node_modules/@playwright/test/index.js:17:18) at Module._compile (node:internal/modules/cjs/loader:1358:14) at Module._extensions..js (node:internal/modules/cjs/loader:1416:10) at Object.i.<computed>.ut._extensions.<computed> [as .js] (/home/runner/work/webpack-dev-server/webpack-dev-server/node_modules/playwright/lib/utilsBundleImpl.js:16:1010) at Module.load (node:internal/modules/cjs/loader:1208:32) at Function.Module._load (node:internal/modules/cjs/loader:1024:12) at Module.require (node:internal/modules/cjs/loader:1233:19) at require (node:internal/modules/helpers:179:18) at Object.<anonymous> (/home/runner/work/webpack-dev-server/webpack-dev-server/test/helpers/playwright-test.js:3:18) at Module._compile (node:internal/modules/cjs/loader:1358:14) at Module.f._compile (/home/runner/work/webpack-dev-server/webpack-dev-server/node_modules/playwright/lib/utilsBundleImpl.js:16:994) at Module._extensions..js (node:internal/modules/cjs/loader:1416:10) at Object.i.<computed>.ut._extensions.<computed> [as .js] (/home/runner/work/webpack-dev-server/webpack-dev-server/node_modules/playwright/lib/utilsBundleImpl.js:16:1010) at Module.load (node:internal/modules/cjs/loader:1208:32) at Function.Module._load (node:internal/modules/cjs/loader:1024:12) at Module.require (node:internal/modules/cjs/loader:1233:19) at require (node:internal/modules/helpers:179:18) at Object.<anonymous> (/home/runner/work/webpack-dev-server/webpack-dev-server/test/e2e/api.test.js:6:18) at Module._compile (node:internal/modules/cjs/loader:1358:14) at Module.f._compile (/home/runner/work/webpack-dev-server/webpack-dev-server/node_modules/playwright/lib/utilsBundleImpl.js:16:994) at Module._extensions..js (node:internal/modules/cjs/loader:1416:10) at Object.i.<computed>.ut._extensions.<computed> [as .js] (/home/runner/work/webpack-dev-server/webpack-dev-server/node_modules/playwright/lib/utilsBundleImpl.js:16:1010) at

Check failure on line 3 in test/helpers/playwright-test.js

View workflow job for this annotation

GitHub Actions / Test - ubuntu-latest - Node v18.x, Webpack latest (1/4)

[chromium] › app.test.js:59:9 › app option › should work using "express" application and "http" server › should handle GET request to index route (/)

2) [chromium] › app.test.js:59:9 › app option › should work using "express" application and "http" server › should handle GET request to index route (/) Error: Requiring @playwright/test second time, First: Error: at ../helpers/playwright-test.js:3 1 | "use strict"; 2 | > 3 | const { test } = require("@playwright/test"); | ^ 4 | 5 | const customTest = test.extend({ 6 | done: [ at Object.<anonymous> (/home/runner/work/webpack-dev-server/webpack-dev-server/node_modules/playwright/lib/index.js:69:33) at Module._compile (node:internal/modules/cjs/loader:1364:14) at Module._extensions..js (node:internal/modules/cjs/loader:1422:10) at Object.i.<computed>.ut._extensions.<computed> [as .js] (/home/runner/work/webpack-dev-server/webpack-dev-server/node_modules/playwright/lib/utilsBundleImpl.js:16:1010) at Module.load (node:internal/modules/cjs/loader:1203:32) at Function.Module._load (node:internal/modules/cjs/loader:1019:12) at Module.require (node:internal/modules/cjs/loader:1231:19) at require (node:internal/modules/helpers:177:18) at Object.<anonymous> (/home/runner/work/webpack-dev-server/webpack-dev-server/node_modules/playwright/test.js:17:13) at Module._compile (node:internal/modules/cjs/loader:1364:14) at Module._extensions..js (node:internal/modules/cjs/loader:1422:10) at Object.i.<computed>.ut._extensions.<computed> [as .js] (/home/runner/work/webpack-dev-server/webpack-dev-server/node_modules/playwright/lib/utilsBundleImpl.js:16:1010) at Module.load (node:internal/modules/cjs/loader:1203:32) at Function.Module._load (node:internal/modules/cjs/loader:1019:12) at Module.require (node:internal/modules/cjs/loader:1231:19) at require (node:internal/modules/helpers:177:18) at Object.<anonymous> (/home/runner/work/webpack-dev-server/webpack-dev-server/node_modules/@playwright/test/index.js:17:18) at Module._compile (node:internal/modules/cjs/loader:1364:14) at Module._extensions..js (node:internal/modules/cjs/loader:1422:10) at Object.i.<computed>.ut._extensions.<computed> [as .js] (/home/runner/work/webpack-dev-server/webpack-dev-server/node_modules/playwright/lib/utilsBundleImpl.js:16:1010) at Module.load (node:internal/modules/cjs/loader:1203:32) at Function.Module._load (node:internal/modules/cjs/loader:1019:12) at Module.require (node:internal/modules/cjs/loader:1231:19) at require (node:internal/modules/helpers:177:18) at Object.<anonymous> (/home/runner/work/webpack-dev-server/webpack-dev-server/test/helpers/playwright-test.js:3:18) at Module._compile (node:internal/modules/cjs/loader:1364:14) at Module.f._compile (/home/runner/work/webpack-dev-server/webpack-dev-server/node_modules/playwright/lib/utilsBundleImpl.js:16:994) at Module._extensions..js (node:internal/modules/cjs/loader:1422:10) at Object.i.<computed>.ut._extensions.<computed> [as .js] (/home/runner/work/webpack-dev-server/webpack-dev-server/node_modules/playwright/lib/utilsBundleImpl.js:16:1010) at Module.load (node:internal/modules/cjs/loader:1203:32) at Function.Module._load (node:internal/modules/cjs/loader:1019:12) at Module.require (node:internal/modules/cjs/loader:1231:19) at require (node:internal/modules/helpers:177:18) at Object.<anonymous> (/home/runner/work/webpack-dev-server/webpack-dev-server/test/e2e/api.test.js:6:18) at Module._compile (node:internal/modules/cjs/loader:1364:14) at Module.f._compile (/home/runner/work/webpack-dev-server/webpack-dev-server/node_modules/playwright/lib/utilsBundleImpl.js:16:994) at Module._extensions..js (node:internal/modules/cjs/loader:1422:10) at Object.i.<computed>.ut._extensions.<computed> [as .js] (/home/runner/work/webpack-dev-server/webpack-dev-server/node_modules/playwright/lib/utilsBundleImpl.js:16:1010) at

const customTest = test.extend({
done: [
Expand All @@ -19,4 +19,4 @@ const customTest = test.extend({
],
});

module.exports = { test: mergeTests(customTest) };
module.exports = { test: customTest };

0 comments on commit 9998d51

Please sign in to comment.