Skip to content

Commit

Permalink
Update dependencies (#39)
Browse files Browse the repository at this point in the history
* Update Puppeteer

* Update Cypress

* Enable Cypress tests

* Add Puppeteer only workflow

* Remove unused file

* Update Alfa and React

* Remove verbatimModuleSyntax option

* Workaround missing crypto in JSDOM

* Fix enzyme loading cheerio

* Update Alfa

* Re-enable persister

* Update name

* Update to node 20, 22 (remove node 18 due to crypto)
  • Loading branch information
Jym77 authored Sep 9, 2024
1 parent d649237 commit e1c44d1
Show file tree
Hide file tree
Showing 38 changed files with 3,481 additions and 2,136 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/integrate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18, 20]
node-version: [20, 22]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/puppeteer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Puppeteer tests

# We've experienced quite a lot of instability with the puppeteer setup, notably
# the fact that it works locally but not in the Github action. Thus, we've removed
# it from the main integrate workflow, which in turns means we do not have a nice
# way to try and fix it.

# This workflow only runs the puppeteer tests, and MUST NOT be required as a branch
# protection. It will nonetheless let us monitor the status of it and make it easier
# for us to fix the problems once we get to it.

on:
push:
branches:
- main
pull_request:
branches:
- "*"
jobs:
build:
name: Build (puppeteer)
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20, 22]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- uses: actions/cache@v4
with:
path: .yarn/cache
key: yarn-${{ hashFiles('yarn.lock') }}
- run: >
yarn config set
npmScopes.siteimprove.npmAuthToken
${{ secrets.GITHUB_TOKEN }}
- run: yarn install --immutable
- run: yarn build
- run: yarn workspace end-to-end-testing-puppeteer test
14 changes: 7 additions & 7 deletions common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
"./persist.js": "./persist.js"
},
"devDependencies": {
"@siteimprove/alfa-act": "^0.81.0",
"@siteimprove/alfa-assert": "^0.65.2",
"@siteimprove/alfa-formatter": "^0.65.2",
"@siteimprove/alfa-hash": "^0.81.0",
"@siteimprove/alfa-mapper": "^0.81.0"
"@siteimprove/alfa-act": "^0.90.1",
"@siteimprove/alfa-assert": "^0.71.1",
"@siteimprove/alfa-formatter": "^0.71.1",
"@siteimprove/alfa-hash": "^0.90.1",
"@siteimprove/alfa-mapper": "^0.90.1"
},
"dependencies": {
"@siteimprove/alfa-formatter-earl": "^0.65.2",
"@siteimprove/alfa-future": "^0.81.0"
"@siteimprove/alfa-formatter-earl": "^0.71.1",
"@siteimprove/alfa-future": "^0.90.1"
}
}
2 changes: 1 addition & 1 deletion common/persist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import * as path from "path";

export function persist<I, T extends Hashable, Q extends Question.Metadata, S>(
output: Mapper<I, string>,
format: Formatter<I, T, Q, S> = earl.default()
format: Formatter<I, T, Q, S> = earl()
): Handler<I, T, Q, S> {
return (input, rules, outcomes, message) =>
Future.from(async () => {
Expand Down
18 changes: 9 additions & 9 deletions custom-testing/adding-rules/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
"node": ">=20.0.0"
},
"devDependencies": {
"@siteimprove/alfa-act": "^0.81.0",
"@siteimprove/alfa-chai": "^0.65.2",
"@siteimprove/alfa-dom": "^0.81.0",
"@siteimprove/alfa-future": "^0.81.0",
"@siteimprove/alfa-playwright": "^0.65.2",
"@siteimprove/alfa-refinement": "^0.81.0",
"@siteimprove/alfa-result": "^0.81.0",
"@siteimprove/alfa-rules": "^0.81.0",
"@siteimprove/alfa-web": "^0.81.0",
"@siteimprove/alfa-act": "^0.90.1",
"@siteimprove/alfa-chai": "^0.71.1",
"@siteimprove/alfa-dom": "^0.90.1",
"@siteimprove/alfa-future": "^0.90.1",
"@siteimprove/alfa-playwright": "^0.71.1",
"@siteimprove/alfa-refinement": "^0.90.1",
"@siteimprove/alfa-result": "^0.90.1",
"@siteimprove/alfa-rules": "^0.90.1",
"@siteimprove/alfa-web": "^0.90.1",
"@types/chai": "^4.2.3",
"@types/mocha": "^5.2.7",
"chai": "^4.3.4",
Expand Down
2 changes: 1 addition & 1 deletion custom-testing/adding-rules/test/page.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const myRule = Rule.Atomic.of<Page, Element>({
});

// adding myRule to the default ruleset
const allRules = rules.default.append(myRule);
const allRules = rules.append(myRule);

// Creating a Chai plugin which runs all rules (default and custom).
chai.use(
Expand Down
20 changes: 10 additions & 10 deletions custom-testing/answering/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
"node": ">=20.0.0"
},
"devDependencies": {
"@siteimprove/alfa-act": "^0.81.0",
"@siteimprove/alfa-chai": "^0.65.2",
"@siteimprove/alfa-css": "^0.81.0",
"@siteimprove/alfa-dom": "^0.81.0",
"@siteimprove/alfa-future": "^0.81.0",
"@siteimprove/alfa-hash": "^0.81.0",
"@siteimprove/alfa-option": "^0.81.0",
"@siteimprove/alfa-playwright": "^0.65.2",
"@siteimprove/alfa-refinement": "^0.81.0",
"@siteimprove/alfa-rules": "^0.81.0",
"@siteimprove/alfa-act": "^0.90.1",
"@siteimprove/alfa-chai": "^0.71.1",
"@siteimprove/alfa-css": "^0.90.1",
"@siteimprove/alfa-dom": "^0.90.1",
"@siteimprove/alfa-future": "^0.90.1",
"@siteimprove/alfa-hash": "^0.90.1",
"@siteimprove/alfa-option": "^0.90.1",
"@siteimprove/alfa-playwright": "^0.71.1",
"@siteimprove/alfa-refinement": "^0.90.1",
"@siteimprove/alfa-rules": "^0.90.1",
"@types/chai": "^4.2.3",
"@types/mocha": "^5.2.7",
"chai": "^4.3.4",
Expand Down
6 changes: 3 additions & 3 deletions custom-testing/answering/test/answering.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const { and } = Refinement;
chai.use(
alfa.Chai.createPlugin(
(value: Playwright.Type) => Future.from(Playwright.toPage(value)),
rules.default.filter((rule) => !rule.uri.includes("r111")),
rules.filter((rule) => !rule.uri.includes("r111")),
[persist(() => "test/outcomes/page.spec.json")]
)
);
Expand Down Expand Up @@ -116,8 +116,8 @@ function oracle<I, T extends Hashable, S>(
* page.
*/
describe("page.html", () => {
beforeEach(setup);
afterEach(teardown);
before(setup);
after(teardown);

// By default, only Failed outcomes are considered
it("should not have any Failed outcome", async () => {
Expand Down
2 changes: 1 addition & 1 deletion custom-testing/crawling/crawling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const frontier = Frontier.of(scope, [scope, ...seed]);
Crawler.with(async (crawler) => {
for await (const result of crawler.crawl(frontier)) {
for (const input of result) {
const outcomes = await Audit.of(input, rules.default)
const outcomes = await Audit.of(input, rules)
.evaluate()
.map((outcomes) => [...outcomes]);

Expand Down
10 changes: 5 additions & 5 deletions custom-testing/crawling/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
"node": ">=20.0.0"
},
"devDependencies": {
"@siteimprove/alfa-act": "^0.81.0",
"@siteimprove/alfa-crawler": "^0.65.2",
"@siteimprove/alfa-frontier": "^0.65.2",
"@siteimprove/alfa-hash": "^0.81.0",
"@siteimprove/alfa-rules": "^0.81.0"
"@siteimprove/alfa-act": "^0.90.1",
"@siteimprove/alfa-crawler": "^0.71.1",
"@siteimprove/alfa-frontier": "^0.71.1",
"@siteimprove/alfa-hash": "^0.90.1",
"@siteimprove/alfa-rules": "^0.90.1"
}
}
18 changes: 9 additions & 9 deletions custom-testing/filtering/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
"node": ">=20.0.0"
},
"devDependencies": {
"@siteimprove/alfa-act": "^0.81.0",
"@siteimprove/alfa-chai": "^0.65.2",
"@siteimprove/alfa-future": "^0.81.0",
"@siteimprove/alfa-hash": "^0.81.0",
"@siteimprove/alfa-iterable": "^0.81.0",
"@siteimprove/alfa-playwright": "^0.65.2",
"@siteimprove/alfa-refinement": "^0.81.0",
"@siteimprove/alfa-rules": "^0.81.0",
"@siteimprove/alfa-wcag": "^0.81.0",
"@siteimprove/alfa-act": "^0.90.1",
"@siteimprove/alfa-chai": "^0.71.1",
"@siteimprove/alfa-future": "^0.90.1",
"@siteimprove/alfa-hash": "^0.90.1",
"@siteimprove/alfa-iterable": "^0.90.1",
"@siteimprove/alfa-playwright": "^0.71.1",
"@siteimprove/alfa-refinement": "^0.90.1",
"@siteimprove/alfa-rules": "^0.90.1",
"@siteimprove/alfa-wcag": "^0.90.1",
"@types/chai": "^4.2.3",
"@types/mocha": "^5.2.7",
"chai": "^4.3.4",
Expand Down
2 changes: 1 addition & 1 deletion custom-testing/filtering/test/filtering.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const { and } = Refinement;
chai.use(
alfa.Chai.createPlugin(
(value: Playwright.Type) => Future.from(Playwright.toPage(value)),
rules.default.filter((rule) => !rule.uri.includes("r111")),
rules.filter((rule) => !rule.uri.includes("r111")),
[persist(() => "test/outcomes/filtering.spec.json")]
)
);
Expand Down
8 changes: 4 additions & 4 deletions custom-testing/interacting/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
"node": ">=20.0.0"
},
"devDependencies": {
"@siteimprove/alfa-chai": "^0.65.2",
"@siteimprove/alfa-future": "^0.81.0",
"@siteimprove/alfa-playwright": "^0.65.2",
"@siteimprove/alfa-rules": "^0.81.0",
"@siteimprove/alfa-chai": "^0.71.1",
"@siteimprove/alfa-future": "^0.90.1",
"@siteimprove/alfa-playwright": "^0.71.1",
"@siteimprove/alfa-rules": "^0.90.1",
"@types/chai": "^4.2.3",
"@types/mocha": "^5.2.7",
"chai": "^4.3.4",
Expand Down
12 changes: 6 additions & 6 deletions custom-testing/measuring-performances/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
"node": ">=20.0.0"
},
"devDependencies": {
"@siteimprove/alfa-act": "^0.81.0",
"@siteimprove/alfa-aria": "^0.81.0",
"@siteimprove/alfa-cascade": "^0.81.0",
"@siteimprove/alfa-performance": "^0.81.0",
"@siteimprove/alfa-rules": "^0.81.0",
"@siteimprove/alfa-scraper": "^0.65.2"
"@siteimprove/alfa-act": "^0.90.1",
"@siteimprove/alfa-aria": "^0.90.1",
"@siteimprove/alfa-cascade": "^0.90.1",
"@siteimprove/alfa-performance": "^0.90.1",
"@siteimprove/alfa-rules": "^0.90.1",
"@siteimprove/alfa-scraper": "^0.71.1"
}
}
2 changes: 1 addition & 1 deletion custom-testing/measuring-performances/performance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Scraper.with(async (scraper) => {

// The Performance object with its callback listener is passed to the Audit
// evaluation.
await Audit.of(page, rules.default).evaluate(rulesPerformance);
await Audit.of(page, rules).evaluate(rulesPerformance);

// Closing the total duration measurement.
commonPerformance.measure("total", start);
Expand Down
8 changes: 4 additions & 4 deletions custom-testing/navigating/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
"node": ">=20.0.0"
},
"devDependencies": {
"@siteimprove/alfa-chai": "^0.65.2",
"@siteimprove/alfa-future": "^0.81.0",
"@siteimprove/alfa-playwright": "^0.65.2",
"@siteimprove/alfa-rules": "^0.81.0",
"@siteimprove/alfa-chai": "^0.71.1",
"@siteimprove/alfa-future": "^0.90.1",
"@siteimprove/alfa-playwright": "^0.71.1",
"@siteimprove/alfa-rules": "^0.90.1",
"@types/chai": "^4.2.3",
"@types/mocha": "^5.2.7",
"chai": "^4.3.4",
Expand Down
8 changes: 4 additions & 4 deletions custom-testing/scraping/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"test": "node scraping.js"
},
"devDependencies": {
"@siteimprove/alfa-act": "^0.81.0",
"@siteimprove/alfa-hash": "^0.81.0",
"@siteimprove/alfa-rules": "^0.81.0",
"@siteimprove/alfa-scraper": "^0.65.2"
"@siteimprove/alfa-act": "^0.90.1",
"@siteimprove/alfa-hash": "^0.90.1",
"@siteimprove/alfa-rules": "^0.90.1",
"@siteimprove/alfa-scraper": "^0.71.1"
}
}
2 changes: 1 addition & 1 deletion custom-testing/scraping/scraping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Scraper.with(async (scraper) => {
}

for (const input of alfaPage) {
const outcomes = await Audit.of(input, rules.default)
const outcomes = await Audit.of(input, rules)
.evaluate()
.map((outcomes) => [...outcomes]);

Expand Down
3 changes: 1 addition & 2 deletions end-to-end-testing/cypress/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
videos
screenshots
!cypress.config.js
15 changes: 15 additions & 0 deletions end-to-end-testing/cypress/cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { defineConfig } from "cypress";

export default defineConfig({
fixturesFolder: "fixtures",
screenshotsFolder: "screenshots",
videosFolder: "videos",

e2e: {
setupNodeEvents(on, config) {
// implement node event listeners here
},
supportFile: "support.js",
specPattern: "test/**.spec.js",
},
});
9 changes: 0 additions & 9 deletions end-to-end-testing/cypress/cypress.json

This file was deleted.

6 changes: 3 additions & 3 deletions end-to-end-testing/cypress/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"node": ">=20.0.0"
},
"devDependencies": {
"@siteimprove/alfa-cypress": "^0.65.2",
"@siteimprove/alfa-rules": "^0.81.0",
"cypress": "^7.0.1"
"@siteimprove/alfa-cypress": "^0.71.1",
"@siteimprove/alfa-rules": "^0.90.1",
"cypress": "^13.3.1"
}
}
2 changes: 1 addition & 1 deletion end-to-end-testing/cypress/support.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Cypress } from "@siteimprove/alfa-cypress";
import rules from "@siteimprove/alfa-rules";

chai.use(
Cypress.createPlugin(rules.default, [
Cypress.createPlugin(rules, [
Cypress.Handler.persist(() => "outcomes/page.spec.json"),
])
);
8 changes: 4 additions & 4 deletions end-to-end-testing/playwright/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
"node": ">=20.0.0"
},
"devDependencies": {
"@siteimprove/alfa-chai": "^0.65.2",
"@siteimprove/alfa-future": "^0.81.0",
"@siteimprove/alfa-playwright": "^0.65.2",
"@siteimprove/alfa-rules": "^0.81.0",
"@siteimprove/alfa-chai": "^0.71.1",
"@siteimprove/alfa-future": "^0.90.1",
"@siteimprove/alfa-playwright": "^0.71.1",
"@siteimprove/alfa-rules": "^0.90.1",
"@types/chai": "^4.2.3",
"@types/mocha": "^5.2.7",
"chai": "^4.3.4",
Expand Down
2 changes: 1 addition & 1 deletion end-to-end-testing/playwright/test/page.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const __dirname = path.dirname(__filename);
chai.use(
alfa.Chai.createPlugin(
(value: Playwright.Type) => Future.from(Playwright.toPage(value)),
rules.default.filter((rule) => !rule.uri.includes("r111")),
rules.filter((rule) => !rule.uri.includes("r111")),
[persist(() => "test/outcomes/page.spec.json")]
)
);
Expand Down
10 changes: 5 additions & 5 deletions end-to-end-testing/puppeteer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
"node": ">=20.0.0"
},
"devDependencies": {
"@siteimprove/alfa-chai": "^0.65.2",
"@siteimprove/alfa-future": "^0.81.0",
"@siteimprove/alfa-puppeteer": "^0.65.2",
"@siteimprove/alfa-rules": "^0.81.0",
"@siteimprove/alfa-chai": "^0.71.1",
"@siteimprove/alfa-future": "^0.90.1",
"@siteimprove/alfa-puppeteer": "^0.71.1",
"@siteimprove/alfa-rules": "^0.90.1",
"@types/chai": "^4.2.3",
"@types/mocha": "^5.2.7",
"chai": "^4.3.4",
"common": "workspace:^",
"mocha": "^8.3.2",
"puppeteer": "^8.0.0"
"puppeteer": "^22.14.0"
}
}
Loading

0 comments on commit e1c44d1

Please sign in to comment.