-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Jest and enable Renovate (#102)
* Make framework exception more generic * Add basic Jest test * Update Jest * Enable Jest updates --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
1ab81f9
commit bce02db
Showing
11 changed files
with
587 additions
and
600 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
{ | ||
"$schema": "http://json.schemastore.org/tsconfig", | ||
"extends": "../tsconfig.json", | ||
"compilerOptions": { "outDir": "../dist" }, | ||
"compilerOptions": { | ||
"outDir": "../dist" | ||
}, | ||
"files": ["./index.ts", "./jest.ts"], | ||
"references": [{ "path": "../../alfa-assert" }] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { Device } from "@siteimprove/alfa-device"; | ||
import { h } from "@siteimprove/alfa-dom"; | ||
import { Request, Response } from "@siteimprove/alfa-http"; | ||
import { Rules } from "@siteimprove/alfa-rules"; | ||
import { Page } from "@siteimprove/alfa-web"; | ||
|
||
import { Jest } from "../dist/jest.js"; | ||
|
||
Jest.createPlugin((page: Page) => page, [Rules.get("R12").getUnsafe()]); | ||
|
||
describe(".createPlugin adds a .toBeAccessible method", () => { | ||
const page = Page.of( | ||
Request.empty(), | ||
Response.empty(), | ||
h.document([<button>Hello World</button>]), | ||
Device.standard() | ||
); | ||
|
||
it("should have a .toBeAccessible method", async () => { | ||
await expect(page).toBeAccessible(); | ||
}); | ||
}); | ||
|
||
describe(".createPlugin adds a .not.toBeAccessible method", () => { | ||
const page = Page.of( | ||
Request.empty(), | ||
Response.empty(), | ||
h.document([<button></button>]), | ||
Device.standard() | ||
); | ||
|
||
it("should have a .not.toBeAccessible method", async () => { | ||
await expect(page).not.toBeAccessible(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"$schema": "http://json.schemastore.org/tsconfig", | ||
"extends": "../tsconfig.json", | ||
"compilerOptions": { | ||
"outDir": ".", | ||
"jsx": "react-jsx", | ||
"jsxImportSource": "@siteimprove/alfa-dom", | ||
"types": ["jest"] | ||
}, | ||
"files": ["./jest.spec.tsx"], | ||
"references": [{ "path": "../src" }] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"$schema": "http://json.schemastore.org/tsconfig", | ||
"extends": "../tsconfig.json", | ||
"references": [{ "path": "./src" }] | ||
"references": [{ "path": "./src" }, { "path": "./test" }] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.