mirror of
https://github.com/tenrok/vue-meta.git
synced 2026-06-23 10:50:33 +03:00
test: add options to generate test
This commit is contained in:
@@ -119,14 +119,16 @@ describe('plugin', () => {
|
|||||||
warn.mockRestore()
|
warn.mockRestore()
|
||||||
})
|
})
|
||||||
|
|
||||||
test('can use generate export', () => {
|
test('can use generate export with options', () => {
|
||||||
process.server = true
|
process.server = true
|
||||||
const rawInfo = {
|
const rawInfo = {
|
||||||
meta: [{ charset: 'utf-8' }]
|
meta: [{ charset: 'utf-8' }]
|
||||||
}
|
}
|
||||||
|
|
||||||
const metaInfo = VueMetaPlugin.generate(rawInfo)
|
const metaInfo = VueMetaPlugin.generate(rawInfo, {
|
||||||
expect(metaInfo.meta.text()).toBe('<meta data-vue-meta="ssr" charset="utf-8">')
|
ssrAppId: 'my-test-app-id'
|
||||||
|
})
|
||||||
|
expect(metaInfo.meta.text()).toBe('<meta data-vue-meta="my-test-app-id" charset="utf-8">')
|
||||||
|
|
||||||
// no error on not provided metaInfo types
|
// no error on not provided metaInfo types
|
||||||
expect(metaInfo.script.text()).toBe('')
|
expect(metaInfo.script.text()).toBe('')
|
||||||
|
|||||||
Reference in New Issue
Block a user