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

Error when running native node test-runner module + tap-spec + esm #86

Open
ErickWendel opened this issue Aug 8, 2022 · 0 comments
Open

Comments

@ErickWendel
Copy link

Using the Node.js v18.7 and tap-spec to pipe results from the node test runner the ntl command outputs ✖ Error building interactive interface and the nt throws an exception

Steps for reproducing the error:

// test.mjs
import {
  describe,
  it
} from 'node:test'
import {
  deepStrictEqual
} from 'node:assert'

describe('Array new features', () => {
  describe('new immutable array functions', () => {
    it('old way to change arrays (mutable)', () => {
      const items = [1, 3, 2]
      items.sort() // [1, 2, 3]

      deepStrictEqual(items, [1, 2, 3])
    });
  });
});

My script in the package.json file

//package.json
"scripts": {
    "test": "node --no-warnings mytest.mjs | tap-spec"
 },
"devDependencies": {
    "tap-spec": "^5.0.0"
 },

Using ntl

ntl
⬢  Node Task List
? Select a task to run: test

> recorded@0.0.1 test
> node --no-warnings mytest.mjs | tap-spec

        # Subtest: new immutable array functions
            # Subtest: old way to change arrays (mutable)
            ok 1 - old way to change arrays (mutable)
              ---
              duration_ms: 0.000995537
              ...

  Subtest: Array new features

        ok 1 - new immutable array functions
          ---
          duration_ms: 0.003098021
          ...
    ✔ Array new features
✖  Error building interactive interface
nt 

> recorded@0.0.1 test
> node --no-warnings mytest.mjs | tap-spec

        # Subtest: new immutable array functions
            # Subtest: old way to change arrays (mutable)
            ok 1 - old way to change arrays (mutable)
              ---
              duration_ms: 0.001907764
              ...

  Subtest: Array new features

        ok 1 - new immutable array functions
          ---
          duration_ms: 0.003592342
          ...
    ✔ Array new features
node:child_process:926
    throw err;
    ^

Error: Command failed: npm run test
    at checkExecSyncError (node:child_process:851:11)
    at execSync (node:child_process:923:15)
    at /Users/erickwendel/.nvm/versions/node/v18.7.0/lib/node_modules/ntl/cli.js:198:3
    at Array.forEach (<anonymous>)
    at executeCommands (/Users/erickwendel/.nvm/versions/node/v18.7.0/lib/node_modules/ntl/cli.js:197:7)
    at runCachedTask (/Users/erickwendel/.nvm/versions/node/v18.7.0/lib/node_modules/ntl/cli.js:166:3)
    at hasCachedTasks (/Users/erickwendel/.nvm/versions/node/v18.7.0/lib/node_modules/ntl/cli.js:170:9)
    at run (/Users/erickwendel/.nvm/versions/node/v18.7.0/lib/node_modules/ntl/cli.js:262:6)
    at Object.<anonymous> (/Users/erickwendel/.nvm/versions/node/v18.7.0/lib/node_modules/ntl/cli.js:294:2) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 33161,
  stdout: null,
  stderr: null
}

Node.js v18.7.0
@ErickWendel ErickWendel changed the title Error when running native node test-runner module Error when running native node test-runner module + tap-spec Aug 8, 2022
@ErickWendel ErickWendel changed the title Error when running native node test-runner module + tap-spec Error when running native node test-runner module + tap-spec + esm Aug 8, 2022
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

1 participant