|
1 | 1 | import { path, templateRenderer } from '@vuepress/utils'
|
2 |
| -import { describe, expect, it } from 'vitest' |
| 2 | +import { expect, it } from 'vitest' |
3 | 3 | import type { Bundler } from '../../src/index.js'
|
4 | 4 | import { resolveAppOptions } from '../../src/index.js'
|
5 | 5 |
|
6 |
| -describe('core > app > resolveAppOptions', () => { |
7 |
| - it('should create app options with default values', () => { |
8 |
| - const source = '/foo' |
| 6 | +it('should create app options with default values', () => { |
| 7 | + const source = '/foo' |
9 | 8 |
|
10 |
| - expect( |
11 |
| - resolveAppOptions({ |
12 |
| - source, |
13 |
| - theme: { name: 'theme' }, |
14 |
| - bundler: { name: 'bundler' } as Bundler, |
15 |
| - }), |
16 |
| - ).toEqual({ |
17 |
| - base: '/', |
18 |
| - lang: 'en-US', |
19 |
| - title: '', |
20 |
| - description: '', |
21 |
| - head: [], |
22 |
| - locales: {}, |
23 |
| - theme: { name: 'theme' }, |
24 |
| - bundler: { name: 'bundler' }, |
| 9 | + expect( |
| 10 | + resolveAppOptions({ |
25 | 11 | source,
|
26 |
| - dest: path.resolve(source, '.vuepress/dist'), |
27 |
| - temp: path.resolve(source, '.vuepress/.temp'), |
28 |
| - cache: path.resolve(source, '.vuepress/.cache'), |
29 |
| - public: path.resolve(source, '.vuepress/public'), |
30 |
| - debug: false, |
31 |
| - host: '0.0.0.0', |
32 |
| - port: 8080, |
33 |
| - open: false, |
34 |
| - pagePatterns: ['**/*.md', '!.vuepress', '!node_modules'], |
35 |
| - permalinkPattern: null, |
36 |
| - templateDev: path.normalize( |
37 |
| - require.resolve('@vuepress/client/templates/dev.html'), |
38 |
| - ), |
39 |
| - templateBuild: path.normalize( |
40 |
| - require.resolve('@vuepress/client/templates/build.html'), |
41 |
| - ), |
42 |
| - templateBuildRenderer: templateRenderer, |
43 |
| - shouldPreload: true, |
44 |
| - shouldPrefetch: true, |
45 |
| - markdown: {}, |
46 |
| - plugins: [], |
47 |
| - }) |
| 12 | + theme: { name: 'theme' }, |
| 13 | + bundler: { name: 'bundler' } as Bundler, |
| 14 | + }), |
| 15 | + ).toEqual({ |
| 16 | + base: '/', |
| 17 | + lang: 'en-US', |
| 18 | + title: '', |
| 19 | + description: '', |
| 20 | + head: [], |
| 21 | + locales: {}, |
| 22 | + theme: { name: 'theme' }, |
| 23 | + bundler: { name: 'bundler' }, |
| 24 | + source, |
| 25 | + dest: path.resolve(source, '.vuepress/dist'), |
| 26 | + temp: path.resolve(source, '.vuepress/.temp'), |
| 27 | + cache: path.resolve(source, '.vuepress/.cache'), |
| 28 | + public: path.resolve(source, '.vuepress/public'), |
| 29 | + debug: false, |
| 30 | + host: '0.0.0.0', |
| 31 | + port: 8080, |
| 32 | + open: false, |
| 33 | + pagePatterns: ['**/*.md', '!.vuepress', '!node_modules'], |
| 34 | + permalinkPattern: null, |
| 35 | + templateDev: path.normalize( |
| 36 | + require.resolve('@vuepress/client/templates/dev.html'), |
| 37 | + ), |
| 38 | + templateBuild: path.normalize( |
| 39 | + require.resolve('@vuepress/client/templates/build.html'), |
| 40 | + ), |
| 41 | + templateBuildRenderer: templateRenderer, |
| 42 | + shouldPreload: true, |
| 43 | + shouldPrefetch: true, |
| 44 | + markdown: {}, |
| 45 | + plugins: [], |
48 | 46 | })
|
49 | 47 | })
|
0 commit comments