-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathvuepress.test.ts
39 lines (33 loc) · 1.08 KB
/
vuepress.test.ts
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
37
38
39
import { describe, test, expect } from 'vitest'
import run from '../src/run.js'
import { options } from './prepare.js'
const getOutput = (str: string) => run(str, options).result
const simpleInput = `::: tip
自动在中文和English之间加入空格
:::`
const simpleOutput = `::: tip
自动在中文和 English 之间加入空格
:::`
const defaultTitleInput = `:::
自动在中文和English之间加入空格
:::`
const defaultTitleOutput = `:::
自动在中文和 English 之间加入空格
:::`
const customTitleInput = `::: tip NOTE
自动在中文和English之间加入空格
:::`
const customTitleOutput = `::: tip NOTE
自动在中文和 English 之间加入空格
:::`
describe('vuepress lint', () => {
test('[vuepress] simple custom container', () => {
expect(getOutput(simpleInput)).toBe(simpleOutput)
})
test('[vuepress] custom container with default title', () => {
expect(getOutput(defaultTitleInput)).toBe(defaultTitleOutput)
})
test('[vuepress] custom container with custom title', () => {
expect(getOutput(customTitleInput)).toBe(customTitleOutput)
})
})