mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
A bit annoying that Storybook marks required props as optional. Makes it hard to keep those working during refactor.
26 lines
690 B
TypeScript
26 lines
690 B
TypeScript
import type { TestRunnerConfig } from '@storybook/test-runner'
|
|
import { injectAxe, checkA11y } from 'axe-playwright'
|
|
|
|
/*
|
|
* See https://storybook.js.org/docs/writing-tests/test-runner#test-hook-api
|
|
* to learn more about the test-runner hooks API.
|
|
*/
|
|
const config: TestRunnerConfig = {
|
|
async preVisit(page) {
|
|
await injectAxe(page)
|
|
},
|
|
async postVisit(page) {
|
|
await checkA11y(page, 'nextjs-portal', {
|
|
detailedReport: true,
|
|
detailedReportOptions: {
|
|
html: true,
|
|
},
|
|
// Verbose prints additional logs in the terminal on passing tests taking up space
|
|
// that's needed by failed tests.
|
|
verbose: false,
|
|
})
|
|
},
|
|
}
|
|
|
|
export default config
|