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
Failing Test
Example Repo
Runkit Notebook
Code-fenced Examples
var td = require('testdouble')
// Your steps here.
Description
I am already running my tests with
--loader=ts-node/esmto handle TypeScript to ESM compilation and writing my tests in TypeScript.How can I now plug in
Testdoubleto be able to callreplaceEsmin 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
testdoublewith--loader=ts-node/esmEnvironment
node -voutput: v16.13.2npm -v(oryarn --version) output:npm ls testdouble(oryarn list testdouble) version: 3.17.2Failing Test
Example Repo
npm itand observe the issueRunkit Notebook
var td = require('testdouble')at the topCode-fenced Examples