Skip to content

Commit

Permalink
chore: added config file
Browse files Browse the repository at this point in the history
  • Loading branch information
hussedev committed Oct 10, 2024
1 parent d2f9537 commit 860a958
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .storybook/test-runner.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import type { TestRunnerConfig } from "@storybook/test-runner";
import { injectAxe, checkA11y } from "axe-playwright";
import { accessibilityTestsEnabled } from "../config/storybook";

const config: TestRunnerConfig = {
async preVisit(page) {
await injectAxe(page);
},
async postVisit(page) {
if (process.env.RUN_A11Y_TESTS) {
if (accessibilityTestsEnabled) {
await checkA11y(page, "#storybook-root", {
detailedReport: true,
detailedReportOptions: {
Expand Down
3 changes: 3 additions & 0 deletions config/storybook.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const accessibilityTestsEnabled = process.env.STORYBOOK_TEST_ACCESSIBILITY === "true";

export { accessibilityTestsEnabled };

0 comments on commit 860a958

Please sign in to comment.