mirror of
https://github.com/hanzoai/lint-staged.git
synced 2026-10-30 19:37:36 +00:00
18 lines
394 B
JavaScript
18 lines
394 B
JavaScript
import { stdin } from 'mock-stdin'
|
|
import { describe, it } from 'vitest'
|
|
|
|
import { readStdin } from '../../lib/readStdin.js'
|
|
|
|
const mockStdin = stdin()
|
|
|
|
describe('readStdin', () => {
|
|
it('should return stdin', async ({ expect }) => {
|
|
const stdinPromise = readStdin()
|
|
|
|
mockStdin.send('Hello, world!')
|
|
mockStdin.end()
|
|
|
|
expect(await stdinPromise).toEqual('Hello, world!')
|
|
})
|
|
})
|