Download packages/kaos/test/setup.ts from SaylorTwift/kimi-code: direct link, hf CLI and curl.
- Browser
- Download file 491 Bytes
-
https://huggingface.co/SaylorTwift/kimi-code/resolve/main/packages/kaos/test/setup.ts
- Command line
-
hf download hf://SaylorTwift/kimi-code/packages/kaos/test/setup.ts
-
curl -L -o setup.ts https://huggingface.co/SaylorTwift/kimi-code/resolve/main/packages/kaos/test/setup.ts
491 Bytes
| import { beforeEach } from 'vitest'; | |
| import { setCurrentKaos } from '#/current'; | |
| import { LocalKaos } from '#/local'; | |
| const kaos = await LocalKaos.create(); | |
| // Bind synchronously in `beforeEach`. `enterWith` mutates the running async | |
| // context; vitest's test body is awaited next from the same chain, so it | |
| // inherits the binding. An `await` inside `beforeEach` would push the bind | |
| // into a child context that the test body wouldn't see. | |
| beforeEach(() => { | |
| setCurrentKaos(kaos); | |
| }); | |