Skip to content

Commit cd7d964

Browse files
bcomnesclaude
andcommitted
Add type smoke test for public entry point exports
Imports PageData at runtime and verifies it is a class. TypeScript also checks the @typedef imports for PageInfo, TemplateInfo, LayoutFunctionParams, GlobalDataFunctionParams, PageFunctionParams, and TemplateFunctionParams at compile time via npm run test:tsc. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 00a5d63 commit cd7d964

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// @ts-check
2+
import { test } from 'node:test'
3+
import assert from 'node:assert'
4+
import { PageData } from '../../index.js'
5+
6+
/**
7+
* Smoke test that all public types are importable from the package entry point.
8+
* The @typedef imports below are verified by TypeScript at compile time via `npm run test:tsc`.
9+
*
10+
* @typedef {import('../../index.js').PageInfo} PageInfo
11+
* @typedef {import('../../index.js').TemplateInfo} TemplateInfo
12+
* @typedef {import('../../index.js').LayoutFunctionParams} LayoutFunctionParams
13+
* @typedef {import('../../index.js').GlobalDataFunctionParams} GlobalDataFunctionParams
14+
* @typedef {import('../../index.js').PageFunctionParams} PageFunctionParams
15+
* @typedef {import('../../index.js').TemplateFunctionParams} TemplateFunctionParams
16+
*/
17+
18+
test('PageData is importable from the package entry point', () => {
19+
assert.strictEqual(typeof PageData, 'function', 'PageData is a class')
20+
})

0 commit comments

Comments
 (0)