mirror of
https://github.com/deepseek-ai/deepseek-harness
synced 2026-08-15 21:04:50 +00:00
fix(test): isolate jsdom storage on Node 26
This commit is contained in:
@@ -135,6 +135,23 @@ describe('Oxlint gate', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('Node compatibility graph', () => {
|
||||
it('runs the jsdom environment smoke on every advertised Node line', () => {
|
||||
const subject = withPnpmEntrypoint(() => gatesForMode('node-compat'))
|
||||
|
||||
expect(subject.find(item => item.id === 'vitest-jsdom-smoke')).toMatchObject({
|
||||
label: 'Vitest jsdom smoke',
|
||||
args: [
|
||||
'/private/pnpm.cjs',
|
||||
'exec',
|
||||
'vitest',
|
||||
'run',
|
||||
'scripts/vitest-environment.compat.spec.ts',
|
||||
],
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('Node 24 consumer graph', () => {
|
||||
it('owns the eight-command pool and orders restored-artifact consumers', () => {
|
||||
const subject = withPnpmEntrypoint(() => gatesForMode('ci-consumers'))
|
||||
|
||||
@@ -292,6 +292,11 @@ function nodeCompatSmokeGates(): Gate[] {
|
||||
'run',
|
||||
'apps/cli/tests/source-launch.compat.spec.ts',
|
||||
], { label: 'dsh source-launch smoke' }),
|
||||
pnpmExec('vitest-jsdom-smoke', [
|
||||
'vitest',
|
||||
'run',
|
||||
'scripts/vitest-environment.compat.spec.ts',
|
||||
], { label: 'Vitest jsdom smoke' }),
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
14
scripts/vitest-environment.compat.spec.ts
Normal file
14
scripts/vitest-environment.compat.spec.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
// @vitest-environment jsdom
|
||||
import { describe, expect, it } from 'vitest'
|
||||
|
||||
describe('Vitest jsdom compatibility', () => {
|
||||
it('provides isolated browser storage instead of Node process storage', () => {
|
||||
if (process.allowedNodeEnvironmentFlags.has('--webstorage')) {
|
||||
expect(process.execArgv.filter(argument => argument === '--no-webstorage')).toHaveLength(1)
|
||||
}
|
||||
localStorage.setItem('dsh-vitest-storage-probe', 'available')
|
||||
|
||||
expect(localStorage.getItem('dsh-vitest-storage-probe')).toBe('available')
|
||||
localStorage.removeItem('dsh-vitest-storage-probe')
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user