From bd4d8aaaaf6a0607dde0f7905b20c5373b3229c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Molinero=20Fern=C3=A1ndez?= Date: Wed, 17 Jan 2024 20:57:23 +0100 Subject: [PATCH] Specify browser as argument --- package.json | 6 +++--- test/browser.test.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 1b48d14..fe13890 100644 --- a/package.json +++ b/package.json @@ -48,9 +48,9 @@ "test:deno": "deno test --allow-read=./dist/ ./test/deno.test.js", "test:bun": "bun test --cwd ./test/ bun", "test:browser": "run-s test:browser:*", - "test:browser:chromium": "TEST_BROWSER=chromium node ./test/browser.test.js", - "test:browser:firefox": "TEST_BROWSER=firefox node ./test/browser.test.js", - "test:browser:webkit": "TEST_BROWSER=webkit node ./test/browser.test.js", + "test:browser:chromium": "node ./test/browser.test.js chromium", + "test:browser:firefox": "node ./test/browser.test.js firefox", + "test:browser:webkit": "node ./test/browser.test.js webkit", "version": "run-s all && git add -A ./docs/" }, "devDependencies": { diff --git a/test/browser.test.js b/test/browser.test.js index 4dc34ad..3b289b6 100644 --- a/test/browser.test.js +++ b/test/browser.test.js @@ -14,7 +14,7 @@ const require = module.createRequire(import.meta.url); * $ PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:3000/ npm run test:browser */ -const browserName = process.env.TEST_BROWSER; +const browserName = process.argv[2]; const browserWsEndpoint = process.env.PW_TEST_CONNECT_WS_ENDPOINT; const browser = browserWsEndpoint ? await playwright[browserName].connect(browserWsEndpoint)