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

Using register() with typecheck: false still fails with a type error in test run #2127

Open
MerzDaniel opened this issue Jul 16, 2024 · 0 comments

Comments

@MerzDaniel
Copy link

Search Terms

register
typecheck
test

Expected Behavior

When using

const { register } = require('ts-node')
register({ typeCheck: false })

in my .mocharc.js for my mocha test run

I would expect that tests are run without typecheck.

Actual Behavior

The tests don't run, because ts-node early exits on a typecheck error.

This is really blocking the test-driven coding flow. I have a separate script for doing a typecheck&linting before committing changes. When I run tests, I only want to run tests without caring for types

Steps to reproduce the problem

  1. Use
// .mocharc.js
const { register } = require('ts-node')

register({ typeCheck: false })

module.exports = {
  extensions: [
    'ts',
  ],
}
  1. introduce a small typecheck error
  2. run the tests

Specifications

ts-node v10.9.2
node v20.8.1
compiler v5.4.4
  • Operating system and version:
  • Manjaro Linux (rolling release)
@MerzDaniel MerzDaniel changed the title Using register() with typecheck: false still with a type error in test run Using register() with typecheck: false still fails with a type error in test run Jul 16, 2024
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