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

Watch mode not respecting ignoredByWatcher #2957

Closed
razor-x opened this issue Jan 28, 2022 · 2 comments
Closed

Watch mode not respecting ignoredByWatcher #2957

razor-x opened this issue Jan 28, 2022 · 2 comments

Comments

@razor-x
Copy link
Contributor

razor-x commented Jan 28, 2022

When running a test that saves files to tmp/some-dir/some-file AVA will loop forever in watch mode even if ignoredByWatcher is set. Same behaviour in AVA v3 and v4.

Minimal reproducible example: https://github.com/rxbugs/ava-watch-ignore

Arch Linux

node version    
v16.13.2

AVA version
4.0.1 or 3.15.0
{
  "ignoredByWatcher": ["tmp/**/*"]
}
{
  "type": "module",
  "scripts": {
    "test:watch": "ava -w",
    "test": "ava"
  },
  "devDependencies": {
    "ava": "^4.0.1",
    "mkdirp": "^1.0.4"
  }
}
import path from 'path'
import { promises as fsPromises } from 'fs'

import test from 'ava'
import mkdirp from 'mkdirp'

test.beforeEach(async (t) => {
  const root = 'tmp'
  await mkdirp(root)
  t.context.dst = await fsPromises.mkdtemp(path.join(root, 'foo-'))
})

test('bug', async (t) => {
  await fsPromises.writeFile(path.join(t.context.dst, 'foo'), 'bar')
  t.pass()
})
@novemberborn
Copy link
Member

novemberborn commented Feb 6, 2022

Your configuration isn't being picked up. AVA only support JavaScript configuration files, so you'd want something like ava.config.js:

export default {
  "ignoredByWatcher": ["tmp/**/*"]
}

@razor-x
Copy link
Contributor Author

razor-x commented Feb 6, 2022

Your configuration isn't being picked up. AVA only support JavaScript configuration files, so you'd want something like ava.config.js:

export default {
  "ignoredByWatcher": ["tmp/**/*"]
}

🤦🏻 Thank you. I feel I can't be the only one who missed this change. Can I suggest a waring like this? #2962

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants