Skip to content

Commit

Permalink
remove npm test:move-before now that Chrome 123 supports `Element#m…
Browse files Browse the repository at this point in the history
…oveBefore` natively.
  • Loading branch information
botandrose-machine committed Feb 15, 2025
1 parent 9636309 commit 84c876c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 44 deletions.
14 changes: 0 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,6 @@ jobs:
- name: Run tests
run: npm run ci

test-move-before:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Run tests
run: npm run test:move-before

coverage:
runs-on: ubuntu-latest
steps:
Expand Down
13 changes: 4 additions & 9 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@ npm run ci
```
This will run the tests using Playwright’s headless browser setup across Chrome, Firefox, and WebKit (Safari-adjacent). This is ultimately what gets run in Github Actions to verify PRs. This build will fail if there is an `it.only` left in the codebase, thanks to a custom `--fail-only` command line argument.

To run all tests against Chrome with experimental `moveBefore` support added, execute:
```bash
npm run test:move-before
```
This will start headless Chrome in a new profile with the `atomic-move` experimental flag set. This runs in a separate job in CI.

## Running Individual Tests

### Headless Mode
Expand All @@ -57,9 +51,10 @@ This will start the server, and open the test runner in a browser. From there yo
## GitHub Actions CI matrix
On each push and PR, GitHub Actions runs the following test matrix:

1. Normal baseline `npm run ci` run
2. With experimental moveBefore enabled in the browser
3. Typecheck
1. `npm run ci` - Run all tests on Chrome, Firefox, and WebKit.
2. `npm run test:coverage` - Run all tests, and fail if coverage is below 100%.
3. `npm run typecheck` - Run TypeScript type checking.
4. `npm run format:check`- Check that all files are formatted correctly.

## Code Coverage Report
After a test run completes, you can open `coverage/lcov-report/index.html` to view the code coverage report. On Ubuntu you can run:
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"test": "web-test-runner",
"test:coverage": "npm run ci && node test/lib/ensure-full-coverage.js",
"test:debug": "web-test-runner --manual --open",
"test:move-before": "USE_MOVE_BEFORE=1 web-test-runner",
"ci": "web-test-runner --fail-only --playwright --browsers chromium firefox webkit",
"perf": "node perf/runner.js",
"amd": "(echo \"define(() => {\n\" && cat src/idiomorph.js && echo \"\nreturn Idiomorph});\") > dist/idiomorph.amd.js",
Expand Down
21 changes: 1 addition & 20 deletions web-test-runner.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ let config = {
<head>
<script src="/node_modules/chai/chai.js"></script>
<script src="/node_modules/chai-dom/chai-dom.js"></script>
<script>
should = chai.should();
window.useMoveBefore = ${process.env.USE_MOVE_BEFORE};
</script>
<script>should = chai.should();</script>
<script src="/test/lib/utilities.js"></script>
<script src="/test/lib/wait-for.js"></script>
<script src="/node_modules/sinon/pkg/sinon.js"></script>
Expand Down Expand Up @@ -48,20 +45,4 @@ let config = {
reporters: [summaryReporter(), defaultReporter()],
};

if (process.env.USE_MOVE_BEFORE) {
// configure chrome to use a custom profile directory we control
config.browsers = [
chromeLauncher({
launchOptions: { args: ["--user-data-dir=test/chrome-profile"] },
}),
];
exec(
[
"rm -rf test/chrome-profile", // clear profile out from last run
"mkdir -p test/chrome-profile", // create from scratch
`echo '{"browser":{"enabled_labs_experiments":["atomic-move@1"]}}' > test/chrome-profile/Local\\ State`, // enable experiment
].join(" && "),
);
}

export default config;

0 comments on commit 84c876c

Please sign in to comment.