【发布时间】:2020-01-14 01:16:17
【问题描述】:
正在编写一些单元测试,我有一个使用 Vue-meta 设置元信息的组件
我的组件看起来像这样。
export default {
...
metaInfo () {
const expertName = this.getBlogInfo.blog.author.trim()
const fullName = expertName ? `${expertName.first_name} ${expertName.last_name}` : 'Cowsoko'
return {
title: `Dairynomics - Blog post from ${fullName}`,
meta: [
{
vmid: 'og:description',
name: 'og:description',
content: this.description
},
{
vmid: 'og:image',
name: 'og:image',
content: this.getBlogInfo.blog.photo
}
]
}
}
...
【问题讨论】:
标签: unit-testing vue.js testing jestjs vue-component