-
Notifications
You must be signed in to change notification settings - Fork 141
Open
Description
Description
I am already running my tests with --loader=ts-node/esm
to handle TypeScript to ESM compilation and writing my tests in TypeScript.
How can I now plug in Testdouble
to be able to call replaceEsm
in my tests? An example of this would be very useful.
From what I can see we can specify multiple loaders, but I have failed to find the right way to do it:
https://nodejs.org/docs/latest-v16.x/api/esm.html#loaders
(I am, in particular, using Ava)
Issue
It is not clear how to use testdouble
with --loader=ts-node/esm
Environment
-
node -v
output: v16.13.2 -
npm -v
(oryarn --version
) output: -
npm ls testdouble
(oryarn list testdouble
) version: 3.17.2
Failing Test
- Fork the repo
- Add a failing test (probably to the `/regression/src' directory)
- Submit a pull request for the failing test or link to your branch here
Example Repo
- Create a minimal repository that reproduces the issue
- Make sure that a fresh clone can run only
npm it
and observe the issue - Link to that repo here: https://github.com/codan84/jest-ts-experiments/tree/ava-testdouble
Runkit Notebook
- Create a Runkit notebook
- Invoke
var td = require('testdouble')
at the top - Verify the behavior your issue is concerned with by clicking "Run"
- Link to the Runkit here
Code-fenced Examples
var td = require('testdouble')
// Your steps here.
Metadata
Metadata
Assignees
Labels
No labels