Skip to content

Commit

Permalink
fix(playwright): use axe-core source without require.resolve() (#473)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-siek committed Mar 11, 2022
1 parent 49a3b32 commit 62d9240
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/playwright/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as fs from 'fs';
import * as assert from 'assert';
import type { Page, Frame, ElementHandle } from 'playwright';
import type {
Expand All @@ -7,6 +6,7 @@ import type {
SerialContextObject,
PartialResults
} from 'axe-core';
import { source } from 'axe-core';
import { normalizeContext, analyzePage } from './utils';
import type { AxePlaywrightParams } from './types';
import {
Expand All @@ -26,8 +26,6 @@ export default class AxeBuilder {
private legacyMode = false;

constructor({ page, axeSource }: AxePlaywrightParams) {
const axePath = require.resolve('axe-core');
const source = fs.readFileSync(axePath, 'utf-8');
this.page = page;
this.includes = [];
this.excludes = [];
Expand Down

0 comments on commit 62d9240

Please sign in to comment.