You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-5Lines changed: 7 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,11 +74,10 @@ Quibble supports ES Modules. Quibble implements ES module support using [ES Modu
74
74
Loaders](https://nodejs.org/api/esm.html#esm_experimental_loaders) which are the official way to
75
75
"patch" Node.js' module loading mechanism for ESM.
76
76
77
-
> Note that Loader support is currently experimental and unstable. We will be doing our best
78
-
to track the changes in the specification for the upcoming Node.js versions. Also note that
79
-
Quibble ESM support is tested only for versions 13 and above.
77
+
> Note that Loader support is currently experimental and unstable. We are doing our best
78
+
to track the changes in the specification for the upcoming Node.js versions.
80
79
81
-
To use Quibble support, you must run Node with the `quibble` package as the loader:
80
+
If you're running a Node.js version smaller than v20.6.0, you must run Node with the `quibble` package as a loader:
82
81
83
82
```sh
84
83
node --loader=quibble ...
@@ -93,6 +92,9 @@ mocha --loader=quibble ...
93
92
The `quibble` loader will enable the replacement of the ES modules with the stubs you specify, and
94
93
without it, the stubbing will be ignored.
95
94
95
+
For versions larger or equal to v20.6.0, there is no need to specify a `--loader`, as registering the loader
96
+
happens automatically once you use the API.
97
+
96
98
### Restrictions on ESM
97
99
98
100
*`defaultFakeCreator` is not yet supported.
@@ -140,7 +142,7 @@ resolves the path to the module that is the package's entry point:
140
142
but returns an object with two properties:
141
143
*`module`: the module returned by `await import(importPath)`.
142
144
*`modulePath`: the full path to the module (file) that is the entry point to the package/module.
143
-
145
+
144
146
> Note that when mocking internal Node.js modules (e.g. "[fs](https://nodejs.org/api/fs.html)")), you need to mock the named exports both as named exports and as properties in the default export, because Node.js exports internal modules both as named exports and as a default object. Example:
0 commit comments