Skip to content

Commit f31d0ba

Browse files
Merge pull request #21 from DavidYang2149/develop-#9-update-readme
[Feature] Write a library manual (#9)
2 parents 236f599 + 08e3d5c commit f31d0ba

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,22 @@
1-
# jest-next-dynamic-ts
1+
# 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

Comments
 (0)