timpla
Version:
An optimal website development experience for [server-side] web frameworks.
18 lines (15 loc) • 440 B
text/typescript
import * as through from 'through2'
import { sizer } from '../../gulpfile.ts/lib/sizer'
jest.mock('path')
jest.mock('through2')
describe('sizer', () => {
it('should return a stream', () => {
const spyObj: any = jest.spyOn(through, 'obj')
spyObj.mockReturnValue({ hello: 1 })
const result = sizer({
fallbackCwd: '123',
})
expect(spyObj).toHaveBeenCalled()
expect(result).toMatchObject({ hello: 1 })
})
})