Nuxt/packages/server/test/contest.test.js
2019-03-04 20:12:33 +00:00

18 lines
598 B
JavaScript

import ServerContext from '../src/context'
describe('server: ServerContext', () => {
test('should construct context', () => {
const server = {
nuxt: { id: 'test-contest-nuxt' },
globals: { id: 'test-contest-globals' },
options: { id: 'test-contest-options' },
resources: { id: 'test-contest-resources' }
}
const context = new ServerContext(server)
expect(context.nuxt).toBe(server.nuxt)
expect(context.globals).toEqual(server.globals)
expect(context.options).toEqual(server.options)
expect(context.resources).toEqual(server.resources)
})
})