timpla
Version:
An optimal website development experience for [server-side] web frameworks.
25 lines (22 loc) • 727 B
text/typescript
const deepmerge = jest.fn()
jest.mock('../../gulpfile.ts/internal')
jest.mock('deepmerge', () => deepmerge)
import * as internal from '../../gulpfile.ts/internal'
import { configure } from '../../gulpfile.ts/lib/configure'
describe('configure', () => {
it('should merge the config file with defaults', () => {
const mySampleConfig: any = { test: 2 }
configure(mySampleConfig)
expect(deepmerge).toHaveBeenCalledWith(internal.TIMPLA_DEFAULTS, mySampleConfig, {
arrayMerge: internal.arrayMerge,
})
})
it('should return the default when no config is supplied', () => {
const result = configure()
expect(result).toMatchInlineSnapshot(`
Object {
"hello": 1,
}
`)
})
})