vitest-environment.compat.spec.ts 586 B

1234567891011121314
  1. // @vitest-environment jsdom
  2. import { describe, expect, it } from 'vitest'
  3. describe('Vitest jsdom compatibility', () => {
  4. it('provides isolated browser storage instead of Node process storage', () => {
  5. if (process.allowedNodeEnvironmentFlags.has('--webstorage')) {
  6. expect(process.execArgv.filter(argument => argument === '--no-webstorage')).toHaveLength(1)
  7. }
  8. localStorage.setItem('dsh-vitest-storage-probe', 'available')
  9. expect(localStorage.getItem('dsh-vitest-storage-probe')).toBe('available')
  10. localStorage.removeItem('dsh-vitest-storage-probe')
  11. })
  12. })