/
resolveAppOptions.spec.ts
48 lines (46 loc) · 1.39 KB
/
resolveAppOptions.spec.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
40
41
42
43
44
45
46
47
48
import { path, templateRenderer } from '@vuepress/utils'
import { describe, expect, it } from 'vitest'
import { resolveAppOptions } from '../../src/index.js'
describe('core > app > resolveAppOptions', () => {
it('should create app options with default values', () => {
const source = '/foo'
expect(
resolveAppOptions({
source,
theme: { name: 'theme' } as any,
bundler: { name: 'bundler' } as any,
}),
).toEqual({
base: '/',
lang: 'en-US',
title: '',
description: '',
head: [],
locales: {},
theme: { name: 'theme' },
bundler: { name: 'bundler' },
source,
dest: path.resolve(source, '.vuepress/dist'),
temp: path.resolve(source, '.vuepress/.temp'),
cache: path.resolve(source, '.vuepress/.cache'),
public: path.resolve(source, '.vuepress/public'),
debug: false,
host: '0.0.0.0',
port: 8080,
open: false,
pagePatterns: ['**/*.md', '!.vuepress', '!node_modules'],
permalinkPattern: null,
templateDev: path.normalize(
require.resolve('@vuepress/client/templates/dev.html'),
),
templateBuild: path.normalize(
require.resolve('@vuepress/client/templates/build.html'),
),
templateBuildRenderer: templateRenderer,
shouldPreload: true,
shouldPrefetch: true,
markdown: {},
plugins: [],
})
})
})