mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 16:12:12 +00:00
24 lines
678 B
JavaScript
24 lines
678 B
JavaScript
import BuildContext from '../../src/context/build'
|
|
|
|
describe('builder: buildContext', () => {
|
|
test('should construct context', () => {
|
|
const builder = {
|
|
nuxt: { options: {} }
|
|
}
|
|
const context = new BuildContext(builder)
|
|
expect(context._builder).toEqual(builder)
|
|
expect(context.nuxt).toEqual(builder.nuxt)
|
|
expect(context.options).toEqual(builder.nuxt.options)
|
|
expect(context.isStatic).toEqual(false)
|
|
})
|
|
|
|
test('should return builder plugins context', () => {
|
|
const builder = {
|
|
plugins: [],
|
|
nuxt: { options: {} }
|
|
}
|
|
const context = new BuildContext(builder)
|
|
expect(context.plugins).toEqual(builder.plugins)
|
|
})
|
|
})
|