2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-07 17:52:24 +03:00

test: add options to generate test

This commit is contained in:
pimlie
2019-10-07 23:41:03 +02:00
parent 2ce5177ba4
commit eb0bdbe798
+5 -3
View File
@@ -119,14 +119,16 @@ describe('plugin', () => {
warn.mockRestore()
})
test('can use generate export', () => {
test('can use generate export with options', () => {
process.server = true
const rawInfo = {
meta: [{ charset: 'utf-8' }]
}
const metaInfo = VueMetaPlugin.generate(rawInfo)
expect(metaInfo.meta.text()).toBe('<meta data-vue-meta="ssr" charset="utf-8">')
const metaInfo = VueMetaPlugin.generate(rawInfo, {
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
expect(metaInfo.script.text()).toBe('')