UNPKG

timpla

Version:

An optimal website development experience for [server-side] web frameworks.

27 lines (24 loc) 876 B
jest.mock('../../gulpfile.ts/internal') jest.mock('gulp') const cb = jest.fn() import * as internal from '../../gulpfile.ts/internal' import { TIMPLA_DEFAULTS } from '../../gulpfile.ts/lib/TIMPLA_DEFAULTS' import { IFullTimplaConfig } from '../../gulpfile.ts/lib/TIMPLA_INTERFACES' import { sizeReport as sizeReportTask } from '../../gulpfile.ts/tasks/sizeReport' import { clone } from '../helpers' describe('sizeReportTask', () => { it('should call the sizer', () => { const conf: IFullTimplaConfig = clone(TIMPLA_DEFAULTS) const sizeReport = sizeReportTask(conf) const spySizer = jest.spyOn(internal, 'sizer') const result = sizeReport(cb) expect(spySizer.mock.calls[0][0]).toMatchInlineSnapshot(` Object { "dest": "public", "gzip": true, "logger": [MockFunction], } `) expect(result).toBeTruthy() }) })