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