Skip to content

How to use with mocha & ts-node/register?  #84

Open
@bradennapier

Description

@bradennapier

Hey! Thanks for the work on this.

Wondering how we can use this with mocha? tsconfig-paths has its own tsconfig-paths/register to make this work

https://github.com/dividab/tsconfig-paths#with-mocha-and-ts-node

Basically with mocha we have to run mocha -r ts-node/register -- but that wouldnt have the compiler flag.

Would be worthwhile to have the ability to do it which looks like it'd prob just be something like:

// This is the same as ts-node/register except it sets the environment
// variable so that it uses the ttypescript compiler.  This variable
// could just be set in scripts but this convention makes it simpler.
process.env.TS_NODE_COMPILER = 'ttypescript';
// eslint-disable-next-line import/no-extraneous-dependencies
require('ts-node').register();

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions