Skip to content

Rename or delete a watched test file will cause MODULE_NOT_FOUND error #53113

@jakecastelli

Description

@jakecastelli

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    test_runnerIssues and PRs related to the test runner subsystem.watch-modeIssues and PRs related to watch mode

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions