We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 236f599 + 08e3d5c commit f31d0baCopy full SHA for f31d0ba
README.md
@@ -1 +1,22 @@
1
-# jest-next-dynamic-ts
+# jest-next-dynamic-ts
2
+
3
+Inspired by [jest-next-dynamic](https://github.com/FormidableLabs/jest-next-dynamic).
4
5
+Added TypeScript based on jest-next-dynamic.
6
7
+# Usage
8
9
+```js
10
+// This will mock `next/dynamic`, so make sure to import it before any of your
11
+// components.
12
+import preloadAll from "jest-next-dynamic-ts";
13
+// This component can have dynamic imports anywhere in its rendered tree,
14
+// including nested dynamic imports.
15
+import SomeComponent from "./SomeComponent";
16
17
+beforeAll(async () => {
18
+ await preloadAll();
19
+});
20
21
+// Your tests here!
22
+```
0 commit comments