mirror of
https://github.com/vitest-dev/vitest.git
synced 2026-02-01 17:36:51 +00:00
12 lines
380 B
TypeScript
12 lines
380 B
TypeScript
import fs from 'node:fs'
|
|
import { expect, it, vi } from 'vitest'
|
|
import { timeout } from './timeout'
|
|
|
|
// this file is running first, it should not affect file "b.test.ts"
|
|
it('mock is mocked', () => {
|
|
vi.spyOn(fs, 'readFileSync').mockReturnValue('mocked')
|
|
expect(fs.readFileSync('')).toBe('mocked')
|
|
})
|
|
|
|
it('timeout', () => new Promise(resolve => setTimeout(resolve, timeout)))
|