ci: reduce invariant import

This commit is contained in:
imccyu
2026-07-30 21:36:46 +08:00
parent 56a8db2777
commit 9e2f6859f7
2 changed files with 38 additions and 31 deletions

View File

@@ -61,7 +61,8 @@ describe('global test invariant host', () => {
return () => {}
})
const fakeContext = { invariants: { register } } as unknown as Context
for (const [rawPath, companion] of Object.entries(testInvariantCompanions)) {
for (const [rawPath, load] of Object.entries(testInvariantCompanions)) {
const companion = await load()
const path = rawPath.replace(/^\.\.\//, '')
expect(companion.default, path).toBeUndefined()
const unwrapped = loader.unwrapExports(companion) as typeof companion