ahmadnassri / node-nightwatch-accessibility

Nightwatch.js utility assertion for accessibility testing with aXe

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error if CWD is not node_modules' parent directory

rcarton opened this issue · comments

{ Error: ENOENT: no such file or directory, open '/app/test/ui/node_modules/axe-core/axe.min.js'
    at Object.fs.openSync (fs.js:653:18)
    at Object.fs.readFileSync (fs.js:554:33)

Nightwatch is running from /app/test/ui, but node_modules is in /app/node_modules.

You could use https://www.npmjs.com/package/find-node-modules here instead

const source = fs.readFileSync(path.resolve(path.join('node_modules', 'axe-core', 'axe.min.js')), 'utf8')```
commented

#16 resolves this without having to use any other dependencies.

🎉 This is included in version 1.8.0 🎉

The release is available on: