avajs / ava

Node.js test runner that lets you develop with confidence 🚀
MIT License
20.74k stars 1.41k forks source link

Ava won't work with yarn workspaces package named `business-logic` #3320

Closed codan84 closed 8 months ago

codan84 commented 8 months ago

I have a Yarn@4 monorepo (yarn workspaces). Amongst many packages I have one named business-logic. Any ava tests, even the simplest ones, fail with exit code 13.

If I rename this package to something else, tests pass!

Example test I try to run there:

import test from 'ava'

test('placeholder', (t) => {
  t.pass()
})

My ava config:

export default {
  cache: false,
  failWithoutAssertions: false,
  extensions: {
    ts: 'module'
  },
  nodeArguments: [
    '--import=tsimp/import',
    '--import=testdouble'
  ]
}

My typescript config:

{
  "compilerOptions": {
    "target": "ESNext",
    "moduleResolution": "NodeNext",
    "module": "NodeNExt",
    "esModuleInterop": true,
    "resolveJsonModule": true,
    "strict": true,
    "rootDir": "./src",
    "baseUrl": ".",
    "outDir": "./dist",
    "skipLibCheck": true,
    "strictNullChecks": true,
    "noImplicitAny": false,
    "allowJs": true,
    "checkJs": false,
    "experimentalDecorators": true
  },
  "exclude": ["node_modules", "**/test/**"]
}

All other tests in all other packages pass just fine. With exactly the same configs and versions of dependencies (ava@6.2.1, typescript@5.3.3, tsimp@2.0.11). The only way I found to make this test pass is to rename the package. Even renaming to business-logi works. Is there something in Ava that freaks out on paths with business-logic in?

codan84 commented 8 months ago

Never mind, removing the dir and re-cloning / fresh install seems to solve the problem. Joy of modern software, it works when it wants.