ava
ava copied to clipboard
Resolve "require" modules relative to project directory
See https://github.com/avajs/ava/pull/2971#issuecomment-1055760695:
I think we should resolve relative to the project directory, likely we're trying to approximate that with
resolve-cwd
but the CWD doesn't have to be the project directory. I'd classify this as a bug, actually.This is needed so that we import the expected module, without say AVA's dependencies shadowing it.
We may be able to use nodejs.org/api/module.html#modulecreaterequirefilename with the project directory and use the
resolve()
method on that.