-
Notifications
You must be signed in to change notification settings - Fork 4.7k
/
Copy pathindex.spec.js
36 lines (33 loc) · 931 Bytes
/
index.spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
const { createApp } = require('@vuepress/core')
const { getFragments } = require('@vuepress/test-utils')
import containerPlugin from '..'
describe('containers', async () => {
let app
beforeAll(async () => {
app = createApp()
app.options.siteConfig = {
plugins: [
[containerPlugin, { type: 'tip' }],
[containerPlugin, { type: 'warning' }],
[containerPlugin, { type: 'danger' }],
[containerPlugin, {
type: 'slot',
before: info => `<template slot="${info}">`,
after: '</template>'
}],
[containerPlugin, {
type: 'v-pre',
before: '<div v-pre>',
after: '</div>'
}]
]
}
return app.process()
})
getFragments(__dirname).forEach(({ name, content: input }) => {
test(name, () => {
const { html } = app.markdown.render(input)
expect(html).toMatchSnapshot()
})
})
})