Files
ULIVZandGitHub e5d8ed4655 feat: refine node api (#1395)
- fix($core): markdown slot doesn‘t work. (regression of c85f62d)
- docs: fresh Node.JS API.
- test: official plugins.
2019-03-04 23:46:13 +08:00

37 lines
931 B
JavaScript

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()
})
})
})