@@ -76,13 +76,13 @@ Here is an example Pa11y configuration:
7676``` js
7777module .exports = {
7878 defaults: {
79- standard: " WCAG2AAA" ,
80- runners: [" axe" ],
79+ standard: ' WCAG2AAA' ,
80+ runners: [' axe' ],
8181 },
8282
8383 urls: [
84- " https://torchbox.github.io/django-pattern-library/dpl-rendered-patterns/molecules/accordion/accordion.html" ,
85- " https://torchbox.github.io/django-pattern-library/dpl-rendered-patterns/pages/people/person_page.html" ,
84+ ' https://torchbox.github.io/django-pattern-library/dpl-rendered-patterns/molecules/accordion/accordion.html' ,
85+ ' https://torchbox.github.io/django-pattern-library/dpl-rendered-patterns/pages/people/person_page.html' ,
8686 ],
8787};
8888```
@@ -106,7 +106,7 @@ static:
106106 - npm ci
107107 - npm run build:prod
108108 artifacts :
109- name : " static-$CI_JOB_ID"
109+ name : ' static-$CI_JOB_ID'
110110 paths :
111111 - ./demosite/static_compiled
112112 expire_in : 30 mins
@@ -131,7 +131,7 @@ test_python:
131131 - python manage.py render_patterns --wrap-fragment 2>&1 >/dev/null | tee dpl-list.txt
132132 - mv dpl-list.txt dpl-rendered-patterns && cp -R static dpl-rendered-patterns/static && mv dpl-rendered-patterns ../dpl-rendered-patterns
133133 artifacts :
134- name : " test_patterns-$CI_JOB_ID"
134+ name : ' test_patterns-$CI_JOB_ID'
135135 paths :
136136 - ./dpl-rendered-patterns
137137 expire_in : 30 mins
@@ -161,44 +161,44 @@ pa11y:
161161Here is the ` pa11y.config.js`, which will determine what to test based on the output of `render_patterns`, as listed in the `dpl-list.txt` file:
162162
163163` ` ` js
164- const path = require(" path" );
165- const fs = require("fs" );
164+ const path = require(' path' );
165+ const fs = require('fs' );
166166
167167const defaults = {
168168 chromeLaunchConfig: {
169169 // Needed to run Pa11y in GitLab CI.
170- args: [" --no-sandbox" ],
170+ args: [' --no-sandbox' ],
171171 },
172- standard: " WCAG2AA" ,
173- runners: [" axe" ],
172+ standard: ' WCAG2AA' ,
173+ runners: [' axe' ],
174174};
175175
176176// Assume we run tests over a live django-pattern-library instance, unless TEST_ORIGIN is set;
177- const local = " http://localhost:8000/pattern-library/render-pattern/patterns" ;
177+ const local = ' http://localhost:8000/pattern-library/render-pattern/patterns' ;
178178const origin = process.env.TEST_ORIGIN || local;
179179
180180let urls = [];
181181
182182// In CI mode, retrieve the URLs to test from dpl-rendered-patterns.
183183if (process.env.CI) {
184- const list = path.join(__dirname, " dpl-rendered-patterns", " dpl-list.txt" );
184+ const list = path.join(__dirname, ' dpl-rendered-patterns', ' dpl-list.txt' );
185185 const patterns = fs
186- .readFileSync(list, " utf-8" )
187- .split(" \n " )
186+ .readFileSync(list, ' utf-8' )
187+ .split(' \n ' )
188188 .filter((p) => p);
189189
190- urls = patterns.map((p) => ` ${origin}/${p.replace(" patterns/", "" )}`);
190+ urls = patterns.map((p) => ` ${origin}/${p.replace(' patterns/', '' )}`);
191191}
192192
193193// Convert the list of URLs to configuration objects.
194194urls = [...new Set(urls)].map((url) => {
195195 const config = {
196196 url,
197- screenCapture : ` dpl-rendered-patterns/${url.replace(origin, "" )}.png` ,
197+ screenCapture : ` dpl-rendered-patterns/${url.replace(origin, '' )}.png` ,
198198 };
199199
200- if (url.endsWith(" tab-nav-item.html" )) {
201- config.ignore = [...defaults.ignore, " aria-required-parent" ];
200+ if (url.endsWith(' tab-nav-item.html' )) {
201+ config.ignore = [...defaults.ignore, ' aria-required-parent' ];
202202 }
203203
204204 return config;
0 commit comments