Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not search node_modules directories for test files #412

Open
dsherret opened this issue May 29, 2024 · 1 comment
Open

Do not search node_modules directories for test files #412

dsherret opened this issue May 29, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@dsherret
Copy link
Member

As title.

@dsherret dsherret added the bug Something isn't working label May 29, 2024
@joscha
Copy link
Contributor

joscha commented Jun 4, 2024

Just ran into this via bl:

> node test_runner.js


Running tests in ./esm/node_modules/.deno/bl@4.1.0/node_modules/bl/test/test.js...

node:internal/modules/cjs/loader:1143
  const err = new Error(message);
              ^

Error: Cannot find module 'tape'
Require stack:
- /Users/joscha/dev/a-node/npm/esm/node_modules/.deno/bl@4.1.0/node_modules/bl/test/test.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1143:15)
    at Module._load (node:internal/modules/cjs/loader:984:27)
    at Module.require (node:internal/modules/cjs/loader:1231:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/Users/joscha/dev/a-node/npm/esm/node_modules/.deno/bl@4.1.0/node_modules/bl/test/test.js:2:14)
    at Module._compile (node:internal/modules/cjs/loader:1369:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1427:10)
    at Module.load (node:internal/modules/cjs/loader:1206:32)
    at Module._load (node:internal/modules/cjs/loader:1022:12)
    at cjsLoader (node:internal/modules/esm/translators:366:17) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/joscha/dev/a-node/npm/esm/node_modules/.deno/bl@4.1.0/node_modules/bl/test/test.js'
  ]
}

Node.js v20.12.2
error: Uncaught (in promise) Error: npm run test failed with exit code 1
      throw new Error(
            ^
    at runCommand (https://jsr.io/@deno/dnt/0.41.2/lib/utils.ts:56:13)
    at eventLoopTick (ext:core/01_core.js:168:7)
    at async build (https://jsr.io/@deno/dnt/0.41.2/mod.ts:419:5)
    at async file:///Users/joscha/dev/a-node/scripts/build_npm.ts:10:1

was able to work around this by using the rootTestDir option, e.g.:

rootTestDir: './src/tests',

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants