Download node_modules/@tiptap/react/src/use-client.spec.ts from sitcod3/modul-s: direct link, hf CLI and curl.
- Browser
- Download file 888 Bytes
-
https://huggingface.co/spaces/sitcod3/modul-s/resolve/c06e4783a2be21cd7ca9fedf1ede4d4f0156ba3a/node_modules/%40tiptap/react/src/use-client.spec.ts
- Command line
-
hf download hf://spaces/sitcod3/modul-s@c06e4783a2be21cd7ca9fedf1ede4d4f0156ba3a/node_modules/@tiptap/react/src/use-client.spec.ts
-
curl -L -o use-client.spec.ts https://huggingface.co/spaces/sitcod3/modul-s/resolve/c06e4783a2be21cd7ca9fedf1ede4d4f0156ba3a/node_modules/%40tiptap/react/src/use-client.spec.ts
888 Bytes
| /** | |
| * @vitest-environment node | |
| */ | |
| import { readFileSync } from 'node:fs' | |
| import { fileURLToPath } from 'node:url' | |
| import { describe, expect, it } from 'vitest' | |
| // The package boundary must stay a client module so it can be imported from | |
| // React Server Components without evaluating the class components inside. | |
| const entries = ['./index.ts', './menus/index.ts'] | |
| describe('use client boundary', () => { | |
| it.each(entries)('%s starts with the "use client" directive', entry => { | |
| const path = fileURLToPath(new URL(entry, import.meta.url)) | |
| // The directive must be the very first statement (only a BOM may precede | |
| // it), otherwise some RSC tooling ignores it. Do not trim leading blanks. | |
| const firstLine = readFileSync(path, 'utf8') | |
| .replace(/^\uFEFF/, '') | |
| .split('\n')[0] | |
| .trimEnd() | |
| expect(firstLine).toMatch(/^(['"])use client\1;?$/) | |
| }) | |
| }) | |