From 204d747a751f16643297400bdc3beb77225fe696 Mon Sep 17 00:00:00 2001 From: Carl-Erik Kopseng Date: Wed, 11 Sep 2024 09:40:08 +0200 Subject: [PATCH 1/2] Supply correct config for Sauce Labs tests --- mochify.webdriver.cjs | 5 +++++ package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/mochify.webdriver.cjs b/mochify.webdriver.cjs index efd3f8f01..5be25090f 100644 --- a/mochify.webdriver.cjs +++ b/mochify.webdriver.cjs @@ -1,4 +1,9 @@ "use strict"; +const assert = require("node:assert"); + +assert(process.env.BROWSER_NAME); +assert(process.env.SAUCE_USERNAME); +assert(process.env.SAUCE_ACCESS_KEY); module.exports = { driver: "webdriver", diff --git a/package.json b/package.json index bfd53a7be..dab2b2de6 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "test-dev": "npm run test-node -- -n watch -n watch-path=test --node-option watch-path=lib -R min", "test-headless": "mochify --driver puppeteer", "test-coverage": "nyc nyc --exclude-after-remap false mochify --driver puppeteer --bundle 'node coverage.cjs'", - "test-cloud": "npm run test-headless -- --wd", + "test-cloud": "mochify -C mochify.webdriver.cjs", "test-webworker": "mochify --driver puppeteer --serve . test/webworker/webworker-support-assessment.js", "test-esm-support": "mocha test/es2015/module-support-assessment-test.mjs", "test-esm-browser-build": "node test/es2015/check-esm-bundle-is-runnable.js", From 4e2aae515bc234b242dac3e38f4f0b83ea42cd62 Mon Sep 17 00:00:00 2001 From: Carl-Erik Kopseng Date: Wed, 11 Sep 2024 10:01:12 +0200 Subject: [PATCH 2/2] Inelegant (but working) Sauce Labs testing of browsers --- .min-wd | 15 --------------- package.json | 2 +- scripts/test-cloud.sh | 5 +++++ 3 files changed, 6 insertions(+), 16 deletions(-) delete mode 100644 .min-wd create mode 100755 scripts/test-cloud.sh diff --git a/.min-wd b/.min-wd deleted file mode 100644 index 7f9804870..000000000 --- a/.min-wd +++ /dev/null @@ -1,15 +0,0 @@ -{ - "sauceLabs": true, - "browsers": [ - { - "name": "chrome" - }, - { - "name": "firefox" - }, - { - "name": "MicrosoftEdge" - } - ], - "BUILD_VAR": "TRAVIS_BUILD_NUMBER" -} diff --git a/package.json b/package.json index dab2b2de6..7b5ae6bd7 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "test-dev": "npm run test-node -- -n watch -n watch-path=test --node-option watch-path=lib -R min", "test-headless": "mochify --driver puppeteer", "test-coverage": "nyc nyc --exclude-after-remap false mochify --driver puppeteer --bundle 'node coverage.cjs'", - "test-cloud": "mochify -C mochify.webdriver.cjs", + "test-cloud": "./scripts/test-cloud.sh", "test-webworker": "mochify --driver puppeteer --serve . test/webworker/webworker-support-assessment.js", "test-esm-support": "mocha test/es2015/module-support-assessment-test.mjs", "test-esm-browser-build": "node test/es2015/check-esm-bundle-is-runnable.js", diff --git a/scripts/test-cloud.sh b/scripts/test-cloud.sh new file mode 100755 index 000000000..9f6700a78 --- /dev/null +++ b/scripts/test-cloud.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +BROWSER_NAME=MicrosoftEdge mochify -C mochify.webdriver.cjs \ +&& BROWSER_NAME=chrome mochify -C mochify.webdriver.cjs \ +&& BROWSER_NAME=firefox mochify -C mochify.webdriver.cjs