testdouble.js
testdouble.js copied to clipboard
A minimal test double library for TDD with JavaScript
### Description I've been working to migrate some projects to ESM and move from sinon to testdouble in the process. I've found this to be mostly smooth, except when a...
### Description I am trying to do esm mocking using `testdouble` with a mixed Typescript and Javascript project, mostly [following this post](https://blog.testdouble.com/posts/2021-10-29-testing-esm-with-mocha-and-testdouble/) Node 18.6.0 now allows for chaining of loads,...
### Description Trying to use testdouble.js in a test being run by @web/test-runner, a browser automation test runner ### Issue When running, got: 🚧 Browser logs: SyntaxError: The requested module...
Tagging in @connorjclark if he'd be willing to look at these test failures: After updating to [email protected] (this PR https://github.com/testdouble/quibble/pull/72 ), `npm run test:esm` is failing in testdouble.js: ``` $...
v3.16.6 ```js import assert from 'assert'; import 'quibble'; import {LighthouseError} from '../lib/lh-error.js'; assert( (await import('../lib/lh-error.js')).LighthouseError === LighthouseError ); ``` You can replace line 3 with an import for any object...
### Description ES modules are not mocked on windows. Works fine on Mac. ### Environment - [ ] `node -v` output: 14.8.2 - [ ] `yarn --version` output: 1.22.19 -...
### Description Using `replaceEsm` breaks usage of Mongo in the files under test ### Issue See repo for details. I have a module, `A` with a dependency on another module,...
### Description I was evaluating testdouble to do mocking with native ES modules, but I run into a weird error that seems to be a bug. ### Issue it throws...
# Testdouble third-party-test-thing with ESM module based tests using Mocha You can tag this as a Question :) ## Scenario During the course of converting an Opensource module from CJS...
### Description This is a bit of a resurrection of: https://github.com/testdouble/testdouble.js/issues/438, in that browsers are not able to use testdouble.js without a `global` "polyfill", like the following: ```html // testdouble...