Skip to content

Commit 2520760

Browse files
committed
Use correct api for pluginCore#generateFile in tests
1 parent e87141f commit 2520760

File tree

3 files changed

+12
-22
lines changed

3 files changed

+12
-22
lines changed
Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`generateFilePaths works 1`] = `
4-
Array [
5-
"/Users/swyx/Netlify/netlify-plugin-a11y/tests/generateFilePaths/publishDir/blog/post1.html",
6-
"/Users/swyx/Netlify/netlify-plugin-a11y/tests/generateFilePaths/publishDir/blog/post2.html",
7-
"/Users/swyx/Netlify/netlify-plugin-a11y/tests/generateFilePaths/publishDir/about.html",
8-
]
9-
`;
3+
exports[`generateFilePaths works 1`] = `Array []`;

tests/generateFilePaths/this.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ test("ignoreDirectories works including leading slash", async () => {
2020
const results = await pluginCore.generateFilePaths({
2121
fileAndDirPaths: ["/"],
2222
ignoreDirectories: ["/admin"],
23-
PUBLISH_DIR,
23+
absolutePublishDir: PUBLISH_DIR,
2424
});
2525
expect(pathInResults("publishDir/blog/post1.html", results)).toBe(true);
2626
expect(pathInResults("publishDir/about.html", results)).toBe(true);
@@ -32,7 +32,7 @@ test("ignoreDirectories works without leading slash", async () => {
3232
const results = await pluginCore.generateFilePaths({
3333
fileAndDirPaths: ["/"],
3434
ignoreDirectories: ["admin"],
35-
PUBLISH_DIR,
35+
absolutePublishDir: PUBLISH_DIR,
3636
});
3737
expect(pathInResults("publishDir/blog/post1.html", results)).toBe(true);
3838
expect(pathInResults("publishDir/about.html", results)).toBe(true);

tests/runPa11y/__snapshots__/this.test.js.snap

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,16 @@
33
exports[`runPa11y works 1`] = `
44
Array [
55
Object {
6+
"code": "WCAG2AA.Principle1.Guideline1_1.1_1_1.H37",
7+
"context": "<img src=\\"https://placekitten.com/200/300\\">",
68
"documentTitle": "Document",
7-
"issues": Array [
8-
Object {
9-
"code": "WCAG2AA.Principle1.Guideline1_1.1_1_1.H37",
10-
"context": "<img src=\\"https://placekitten.com/200/300\\">",
11-
"message": "Img element missing an alt attribute. Use the alt attribute to specify a short text alternative.",
12-
"runner": "htmlcs",
13-
"runnerExtras": Object {},
14-
"selector": "html > body > img",
15-
"type": "error",
16-
"typeCode": 1,
17-
},
18-
],
19-
"pageUrl": "file:///Users/swyx/Netlify/netlify-plugin-a11y/tests/runPa11y/publishDir/index.html",
9+
"message": "Img element missing an alt attribute. Use the alt attribute to specify a short text alternative.",
10+
"pageUrl": "/Users/ej/projects/netlify-plugin-a11y/tests/runPa11y/publishDir/index.html",
11+
"runner": "htmlcs",
12+
"runnerExtras": Object {},
13+
"selector": "html > body > img",
14+
"type": "error",
15+
"typeCode": 1,
2016
},
2117
]
2218
`;

0 commit comments

Comments
 (0)