mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
17 lines
406 B
JavaScript
17 lines
406 B
JavaScript
|
import test from 'ava'
|
||
|
const utils = require('../lib/utils')
|
||
|
|
||
|
test('encodeHtml', t => {
|
||
|
const html = '<h1>Hello</h1>'
|
||
|
t.is(utils.encodeHtml(html), '<h1>Hello</h1>')
|
||
|
})
|
||
|
|
||
|
test('getContext', t => {
|
||
|
let ctx = utils.getContext({ a: 1 }, { b: 2 })
|
||
|
t.is(utils.getContext.length, 2)
|
||
|
t.is(typeof ctx.req, 'object')
|
||
|
t.is(typeof ctx.res, 'object')
|
||
|
t.is(ctx.req.a, 1)
|
||
|
t.is(ctx.res.b, 2)
|
||
|
})
|