Skip to content

How can I --require .ts files? #87

@trgsv

Description

@trgsv

Hi, I would like to require a file, so it runs before all of my tests.
Example: ts-mocha -r test/setup.ts \"test/**/*.test.ts\"

If I run this I get the following error: TypeError: Unknown file extension ".ts".
If I try to run the setup.mjs file, which I had before, when I wasn't using typescript, all the imports in that file don't work, because they are from .ts files.

What's the best way to get this working with ts-mocha?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions