Skip to content

Commit

Permalink
Fix required not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
linediconsine committed Jan 4, 2024
1 parent 73bbfc0 commit 43fe7bb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ export interface InjectOptions {
}

export const injectAxe = (injectOptions?: InjectOptions) => {

const fileName =
injectOptions?.axeCorePath ||
(typeof require?.resolve === 'function'
(typeof require != 'undefined' && typeof require?.resolve === 'function'
? require.resolve('axe-core/axe.min.js')
: 'node_modules/axe-core/axe.min.js');
cy.readFile<string>(fileName).then((source) =>
Expand Down

0 comments on commit 43fe7bb

Please sign in to comment.