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

node --test-only opennning REPL #48885

Closed
sujeet-agrahari opened this issue Jul 22, 2023 · 1 comment
Closed

node --test-only opennning REPL #48885

sujeet-agrahari opened this issue Jul 22, 2023 · 1 comment

Comments

@sujeet-agrahari
Copy link

Version

v20.4.0

Platform

Darwin MacBook-Pro.local 22.5.0 Darwin Kernel Version 22.5.0

Subsystem

No response

What steps will reproduce the bug?

  1. pnpm init to initialize a project
  2. create test directory and a index.js file inside it,

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


test.only('synchronous passing test', (t) => {
  // This test passes because it does not throw an exception.
  assert.strictEqual(1, 1);
});

test('synchronous failing test', (t) => {
  // This test fails because it throws an exception.
  assert.strictEqual(1, 2);
});

test('asynchronous passing test', async (t) => {
  // This test passes because the Promise returned by the async
  // function is not rejected.
  assert.strictEqual(1, 1);
});
  1. Run node --test-only

How often does it reproduce? Is there a required condition?

There are no required conditions. Anytime, I execute the tests using node --test-only it opens REPL.

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

No response

What do you see instead?

I see the node REPL, instead of test execution.

❯ node --test-only
Welcome to Node.js v20.4.0.
Type ".help" for more information.
> 

Additional information

No response

@cjihrig
Copy link
Contributor

cjihrig commented Jul 22, 2023

You need to pass --test on the command line. --test-only does not start the test runner.

@cjihrig cjihrig closed this as completed Jul 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants