Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Alfa #34

Merged
merged 6 commits into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions common/persist.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
/// <reference types="node" />

import * as fs from "fs";
import * as path from "path";

import { Question } from "@siteimprove/alfa-act";
import { Handler } from "@siteimprove/alfa-assert";
import { Formatter } from "@siteimprove/alfa-formatter";
import earl from "@siteimprove/alfa-formatter-earl";
import { Future } from "@siteimprove/alfa-future";
import { Hashable } from "@siteimprove/alfa-hash";
import { Mapper } from "@siteimprove/alfa-mapper";

import earl from "@siteimprove/alfa-formatter-earl";
import * as fs from "fs";
import * as path from "path";

export function persist<I, T extends Hashable, Q extends Question.Metadata, S>(
output: Mapper<I, string>,
Expand All @@ -22,7 +21,7 @@ export function persist<I, T extends Hashable, Q extends Question.Metadata, S>(
const dir = path.dirname(file);

fs.mkdirSync(dir, { recursive: true });
fs.writeFileSync(file, format(input, rules, outcomes) + "\n");
fs.writeFileSync(file, format(input, rules, [...outcomes]) + "\n");

return `${message}, see the full report at ${file}`;
});
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 @@ -6,15 +6,15 @@
"test": "mocha --timeout 10000"
},
"devDependencies": {
"@siteimprove/alfa-act": "^0.74.0",
"@siteimprove/alfa-chai": "^0.64.8",
"@siteimprove/alfa-dom": "^0.74.0",
"@siteimprove/alfa-future": "^0.74.0",
"@siteimprove/alfa-playwright": "^0.64.8",
"@siteimprove/alfa-refinement": "^0.74.0",
"@siteimprove/alfa-result": "^0.74.0",
"@siteimprove/alfa-rules": "^0.74.0",
"@siteimprove/alfa-web": "^0.74.0",
"@siteimprove/alfa-act": "^0.80.0",
"@siteimprove/alfa-chai": "^0.65.1",
"@siteimprove/alfa-dom": "^0.80.0",
"@siteimprove/alfa-future": "^0.80.0",
"@siteimprove/alfa-playwright": "^0.65.1",
"@siteimprove/alfa-refinement": "^0.80.0",
"@siteimprove/alfa-result": "^0.80.0",
"@siteimprove/alfa-rules": "^0.80.0",
"@siteimprove/alfa-web": "^0.80.0",
"@types/chai": "^4.2.3",
"@types/mocha": "^5.2.7",
"chai": "^4.3.4",
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 @@ -6,16 +6,16 @@
"test": "mocha --timeout 10000"
},
"devDependencies": {
"@siteimprove/alfa-act": "^0.74.0",
"@siteimprove/alfa-css": "^0.74.0",
"@siteimprove/alfa-dom": "^0.74.0",
"@siteimprove/alfa-future": "^0.74.0",
"@siteimprove/alfa-hash": "^0.74.0",
"@siteimprove/alfa-option": "^0.74.0",
"@siteimprove/alfa-refinement": "^0.74.0",
"@siteimprove/alfa-rules": "^0.74.0",
"@siteimprove/alfa-scraper": "^0.64.8",
"@siteimprove/alfa-style": "^0.74.0",
"@siteimprove/alfa-act": "^0.80.0",
"@siteimprove/alfa-css": "^0.80.0",
"@siteimprove/alfa-dom": "^0.80.0",
"@siteimprove/alfa-future": "^0.80.0",
"@siteimprove/alfa-hash": "^0.80.0",
"@siteimprove/alfa-option": "^0.80.0",
"@siteimprove/alfa-refinement": "^0.80.0",
"@siteimprove/alfa-rules": "^0.80.0",
"@siteimprove/alfa-scraper": "^0.65.1",
"@siteimprove/alfa-style": "^0.80.0",
"@types/chai": "^4.2.3",
"@types/mocha": "^5.2.7",
"chai": "^4.3.4",
Expand Down
4 changes: 3 additions & 1 deletion custom-testing/crawling/crawling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ Crawler.with(async (crawler) => {
}
});

function logStats<I, T extends Hashable, Q extends Question.Metadata>(outcomes: Array<Outcome<I, T, Q>>): void {
function logStats<I, T extends Hashable, Q extends Question.Metadata>(
outcomes: Array<Outcome<I, T, Q>>
): void {
console.log(outcomes.filter(Outcome.isPassed).length, "passed outcomes");

console.log(outcomes.filter(Outcome.isFailed).length, "failed 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 @@ -6,10 +6,10 @@
"test": "node crawling.js"
},
"devDependencies": {
"@siteimprove/alfa-act": "^0.74.0",
"@siteimprove/alfa-crawler": "^0.64.8",
"@siteimprove/alfa-frontier": "^0.64.8",
"@siteimprove/alfa-hash": "^0.74.0",
"@siteimprove/alfa-rules": "^0.74.0"
"@siteimprove/alfa-act": "^0.80.0",
"@siteimprove/alfa-crawler": "^0.65.1",
"@siteimprove/alfa-frontier": "^0.65.1",
"@siteimprove/alfa-hash": "^0.80.0",
"@siteimprove/alfa-rules": "^0.80.0"
}
}
18 changes: 9 additions & 9 deletions custom-testing/filtering/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
"test": "mocha --timeout 10000"
},
"devDependencies": {
"@siteimprove/alfa-act": "^0.74.0",
"@siteimprove/alfa-chai": "^0.64.8",
"@siteimprove/alfa-future": "^0.74.0",
"@siteimprove/alfa-hash": "^0.74.0",
"@siteimprove/alfa-iterable": "^0.74.0",
"@siteimprove/alfa-playwright": "^0.64.8",
"@siteimprove/alfa-refinement": "^0.74.0",
"@siteimprove/alfa-rules": "^0.74.0",
"@siteimprove/alfa-wcag": "^0.74.0",
"@siteimprove/alfa-act": "^0.80.0",
"@siteimprove/alfa-chai": "^0.65.1",
"@siteimprove/alfa-future": "^0.80.0",
"@siteimprove/alfa-hash": "^0.80.0",
"@siteimprove/alfa-iterable": "^0.80.0",
"@siteimprove/alfa-playwright": "^0.65.1",
"@siteimprove/alfa-refinement": "^0.80.0",
"@siteimprove/alfa-rules": "^0.80.0",
"@siteimprove/alfa-wcag": "^0.80.0",
"@types/chai": "^4.2.3",
"@types/mocha": "^5.2.7",
"chai": "^4.3.4",
Expand Down
3 changes: 3 additions & 0 deletions custom-testing/filtering/test/fixtures/conformance.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
color: #666;
background-color: white;
}
main {
padding: 40px;
}
</style>
<nav><a href="#main">Skip to main content</a></nav>
<main id="main">
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 @@ -6,10 +6,10 @@
"test": "mocha --timeout 10000"
},
"devDependencies": {
"@siteimprove/alfa-chai": "^0.64.8",
"@siteimprove/alfa-future": "^0.74.0",
"@siteimprove/alfa-playwright": "^0.64.8",
"@siteimprove/alfa-rules": "^0.74.0",
"@siteimprove/alfa-chai": "^0.65.1",
"@siteimprove/alfa-future": "^0.80.0",
"@siteimprove/alfa-playwright": "^0.65.1",
"@siteimprove/alfa-rules": "^0.80.0",
"@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 @@ -6,11 +6,11 @@
"test": "node performance.js"
},
"devDependencies": {
"@siteimprove/alfa-act": "^0.74.0",
"@siteimprove/alfa-aria": "^0.74.0",
"@siteimprove/alfa-cascade": "^0.74.0",
"@siteimprove/alfa-performance": "^0.74.0",
"@siteimprove/alfa-rules": "^0.74.0",
"@siteimprove/alfa-scraper": "^0.64.8"
"@siteimprove/alfa-act": "^0.80.0",
"@siteimprove/alfa-aria": "^0.80.0",
"@siteimprove/alfa-cascade": "^0.80.0",
"@siteimprove/alfa-performance": "^0.80.0",
"@siteimprove/alfa-rules": "^0.80.0",
"@siteimprove/alfa-scraper": "^0.65.1"
}
}
8 changes: 4 additions & 4 deletions custom-testing/navigating/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"test": "mocha --timeout 10000"
},
"devDependencies": {
"@siteimprove/alfa-chai": "^0.64.8",
"@siteimprove/alfa-future": "^0.74.0",
"@siteimprove/alfa-playwright": "^0.64.8",
"@siteimprove/alfa-rules": "^0.74.0",
"@siteimprove/alfa-chai": "^0.65.1",
"@siteimprove/alfa-future": "^0.80.0",
"@siteimprove/alfa-playwright": "^0.65.1",
"@siteimprove/alfa-rules": "^0.80.0",
"@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 @@ -6,9 +6,9 @@
"test": "node scraping.js"
},
"devDependencies": {
"@siteimprove/alfa-act": "^0.74.0",
"@siteimprove/alfa-hash": "^0.74.0",
"@siteimprove/alfa-rules": "^0.74.0",
"@siteimprove/alfa-scraper": "^0.64.8"
"@siteimprove/alfa-act": "^0.80.0",
"@siteimprove/alfa-hash": "^0.80.0",
"@siteimprove/alfa-rules": "^0.80.0",
"@siteimprove/alfa-scraper": "^0.65.1"
}
}
4 changes: 2 additions & 2 deletions end-to-end-testing/cypress/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"test": "cypress run"
},
"devDependencies": {
"@siteimprove/alfa-cypress": "^0.64.8",
"@siteimprove/alfa-rules": "^0.74.0",
"@siteimprove/alfa-cypress": "^0.65.1",
"@siteimprove/alfa-rules": "^0.80.0",
"cypress": "^7.0.1"
}
}
12 changes: 6 additions & 6 deletions end-to-end-testing/playwright/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
"test": "mocha --timeout 10000"
},
"devDependencies": {
"@siteimprove/alfa-assert": "^0.64.8",
"@siteimprove/alfa-chai": "^0.64.8",
"@siteimprove/alfa-formatter-earl": "^0.64.8",
"@siteimprove/alfa-future": "^0.74.0",
"@siteimprove/alfa-playwright": "^0.64.8",
"@siteimprove/alfa-rules": "^0.74.0",
"@siteimprove/alfa-assert": "^0.65.1",
"@siteimprove/alfa-chai": "^0.65.1",
"@siteimprove/alfa-formatter-earl": "^0.65.1",
"@siteimprove/alfa-future": "^0.80.0",
"@siteimprove/alfa-playwright": "^0.65.1",
"@siteimprove/alfa-rules": "^0.80.0",
"@types/chai": "^4.2.3",
"@types/mocha": "^5.2.7",
"chai": "^4.3.4",
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 @@ -6,11 +6,11 @@
"test": "mocha -t 10000"
},
"devDependencies": {
"@siteimprove/alfa-assert": "^0.64.8",
"@siteimprove/alfa-chai": "^0.64.8",
"@siteimprove/alfa-future": "^0.74.0",
"@siteimprove/alfa-puppeteer": "^0.64.8",
"@siteimprove/alfa-rules": "^0.74.0",
"@siteimprove/alfa-assert": "^0.65.1",
"@siteimprove/alfa-chai": "^0.65.1",
"@siteimprove/alfa-future": "^0.80.0",
"@siteimprove/alfa-puppeteer": "^0.65.1",
"@siteimprove/alfa-rules": "^0.80.0",
"@types/chai": "^4.2.3",
"@types/mocha": "^5.2.7",
"chai": "^4.3.4",
Expand Down
10 changes: 5 additions & 5 deletions end-to-end-testing/webdriver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
"test": "wdio wdio.conf.js"
},
"devDependencies": {
"@siteimprove/alfa-assert": "^0.64.8",
"@siteimprove/alfa-chai": "^0.64.8",
"@siteimprove/alfa-future": "^0.74.0",
"@siteimprove/alfa-rules": "^0.74.0",
"@siteimprove/alfa-webdriver": "^0.64.8",
"@siteimprove/alfa-assert": "^0.65.1",
"@siteimprove/alfa-chai": "^0.65.1",
"@siteimprove/alfa-future": "^0.80.0",
"@siteimprove/alfa-rules": "^0.80.0",
"@siteimprove/alfa-webdriver": "^0.65.1",
"@types/chai": "^4.2.3",
"@types/mocha": "^5.2.7",
"@wdio/cli": "^5.14.4",
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
"unit-testing/*"
],
"devDependencies": {
"@siteimprove/alfa-act": "^0.74.0",
"@siteimprove/alfa-assert": "^0.64.8",
"@siteimprove/alfa-formatter": "^0.64.8",
"@siteimprove/alfa-formatter-earl": "^0.64.8",
"@siteimprove/alfa-future": "^0.74.0",
"@siteimprove/alfa-hash": "^0.74.0",
"@siteimprove/alfa-mapper": "^0.74.0",
"@siteimprove/alfa-act": "^0.80.0",
"@siteimprove/alfa-assert": "^0.65.1",
"@siteimprove/alfa-formatter": "^0.65.1",
"@siteimprove/alfa-formatter-earl": "^0.65.1",
"@siteimprove/alfa-future": "^0.80.0",
"@siteimprove/alfa-hash": "^0.80.0",
"@siteimprove/alfa-mapper": "^0.80.0",
"@types/node": "^20.2.3",
"prettier": "^2.2.1",
"typescript": "^5.0.4"
Expand Down
8 changes: 4 additions & 4 deletions unit-testing/angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
"zone.js": "^0.11.4"
},
"devDependencies": {
"@siteimprove/alfa-angular": "^0.64.8",
"@siteimprove/alfa-assert": "^0.64.8",
"@siteimprove/alfa-jest": "^0.64.8",
"@siteimprove/alfa-rules": "^0.74.0",
"@siteimprove/alfa-angular": "^0.65.1",
"@siteimprove/alfa-assert": "^0.65.1",
"@siteimprove/alfa-jest": "^0.65.1",
"@siteimprove/alfa-rules": "^0.80.0",
"@types/jest": "^29.5.1",
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
Expand Down
3 changes: 2 additions & 1 deletion unit-testing/angular/setup.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/// <reference types="node" />

import { Angular } from "@siteimprove/alfa-angular";
import { Future } from "@siteimprove/alfa-future";

import * as alfa from "@siteimprove/alfa-jest";

Expand All @@ -18,7 +19,7 @@ const R12 = Rules.get("R12").getUnsafe();
import { persist } from "../../common/persist";

alfa.Jest.createPlugin(
(value: Angular.Type) => Angular.toPage(value),
(value: Angular.Type) => Future.from(Angular.toPage(value)),
[R12],
[persist(() => "outcomes/button.spec.json")]
);
8 changes: 4 additions & 4 deletions unit-testing/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
"react-dom": "^17.0.2"
},
"devDependencies": {
"@siteimprove/alfa-assert": "^0.64.8",
"@siteimprove/alfa-enzyme": "^0.64.8",
"@siteimprove/alfa-jest": "^0.64.8",
"@siteimprove/alfa-rules": "^0.74.0",
"@siteimprove/alfa-assert": "^0.65.1",
"@siteimprove/alfa-enzyme": "^0.65.1",
"@siteimprove/alfa-jest": "^0.65.1",
"@siteimprove/alfa-rules": "^0.80.0",
"@types/enzyme": "^3.10.5",
"@types/enzyme-adapter-react-16": "^1.0.5",
"@types/jest": "^29.5.1",
Expand Down
8 changes: 4 additions & 4 deletions unit-testing/vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
"vue-template-compiler": "^2.6.12"
},
"devDependencies": {
"@siteimprove/alfa-assert": "^0.64.8",
"@siteimprove/alfa-jest": "^0.64.8",
"@siteimprove/alfa-rules": "^0.74.0",
"@siteimprove/alfa-vue": "^0.64.8",
"@siteimprove/alfa-assert": "^0.65.1",
"@siteimprove/alfa-jest": "^0.65.1",
"@siteimprove/alfa-rules": "^0.80.0",
"@siteimprove/alfa-vue": "^0.65.1",
"@types/jest": "^29.5.1",
"@vue/test-utils": "^1.0.0-beta.29",
"jest": "^29.5.0",
Expand Down
3 changes: 2 additions & 1 deletion unit-testing/vue/setup.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Future } from "@siteimprove/alfa-future";
import { Vue } from "@siteimprove/alfa-vue";

import * as alfa from "@siteimprove/alfa-jest";
Expand All @@ -16,7 +17,7 @@ const R12 = Rules.get("R12").getUnsafe();
import { persist } from "../../common/persist";

alfa.Jest.createPlugin(
(value: Vue.Type) => Vue.toPage(value),
(value: Vue.Type) => Future.from(Vue.toPage(value)),
[R12],
[persist(() => "outcomes/button.spec.json")]
);
Loading