Download packages/experimental/webworker-runtime/tests/node/shim-diff.spec.ts from SaylorTwift/deepseek-harness: direct link, hf CLI and curl.
- Browser
- Download file 3.51 kB
-
https://huggingface.co/SaylorTwift/deepseek-harness/resolve/main/packages/experimental/webworker-runtime/tests/node/shim-diff.spec.ts
- Command line
-
hf download hf://SaylorTwift/deepseek-harness/packages/experimental/webworker-runtime/tests/node/shim-diff.spec.ts
-
curl -L -o shim-diff.spec.ts https://huggingface.co/SaylorTwift/deepseek-harness/resolve/main/packages/experimental/webworker-runtime/tests/node/shim-diff.spec.ts
3.51 kB
| /** | |
| * Differential check of the worker's crypto/url/util shims against Node. | |
| */ | |
| import { expect, test } from 'vitest' | |
| import { createHash as nodeCreateHash } from 'node:crypto' | |
| import { fileURLToPath as nodeFileURLToPath, pathToFileURL as nodePathToFileURL } from 'node:url' | |
| import { isDeepStrictEqual as nodeIsDeepStrictEqual, promisify as nodePromisify } from 'node:util' | |
| import * as shimCrypto from '@deepseek-ai/dsh-experimental-webworker-runtime/src/node/builtin_modules/implemented/crypto.ts' | |
| import * as shimUrl from '@deepseek-ai/dsh-experimental-webworker-runtime/src/node/builtin_modules/implemented/url.ts' | |
| import * as shimUtil from '@deepseek-ai/dsh-experimental-webworker-runtime/src/node/builtin_modules/implemented/util.ts' | |
| const compare = (label: string, actual: unknown, expected: unknown): void => { | |
| const [shimmed, node] = [JSON.stringify(actual), JSON.stringify(expected)] | |
| test(label, () => { expect(shimmed).toBe(node) }) | |
| } | |
| const INPUTS = ['', 'a', 'hello world', '中文字符串', ' |