node icon indicating copy to clipboard operation
node copied to clipboard

Rename or delete a watched test file will cause `MODULE_NOT_FOUND` error

Open jakecastelli opened this issue 9 months ago • 0 comments

Version

v20.10.0

Platform

Darwin 22.2.0 ARM 64

What steps will reproduce the bug?

create a test folder, and then create a couple of test files. .e.g

test
├── 1.mjs
├── 2.mjs
└── 3.mjs

each file can optionally add a dummy test:

import { test } from 'node:test';
import assert from 'node:assert';

test('testTwo', () => {
  assert.equal(1, 1);
});

then run node --watch --test

Rename a file or delete a file under the ./test/ folder, and you will observe the Error: Cannot find module ${your-test-file-name}

What is the expected behavior? Why is that the expected behavior?

The test runner should be able to pick up file rename and file deletion

What do you see instead?

It throws an error

jakecastelli avatar May 23 '24 06:05 jakecastelli