Skip to content

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

Description

@MerzDaniel

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)

Activity

  1. 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[/+] on Jul 16, 2024
  2. akkki007 commented on Apr 15, 2026

    @akkki007

    Is this issue resolved ?
    If not can i work on it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions