1- import { createBaseApp , resolveThemeApi } from '@vuepress/core'
1+ import { createBaseApp , resolveThemeInfo } from '@vuepress/core'
22import { path } from '@vuepress/utils'
33
44const fixtures = ( ...args : string [ ] ) =>
55 path . resolve ( __dirname , '../__fixtures__/' , ...args )
66
7- describe ( 'core > app > resolveThemeApi ' , ( ) => {
7+ describe ( 'core > app > resolveThemeInfo ' , ( ) => {
88 describe ( 'layouts' , ( ) => {
9- it ( 'should resolve theme api without layouts correctly' , ( ) => {
9+ it ( 'should resolve theme info without layouts correctly' , ( ) => {
1010 const app = createBaseApp ( {
1111 source : path . resolve ( __dirname , 'fake-source' ) ,
1212 theme : fixtures ( 'themes/empty.js' ) ,
1313 } )
1414
15- expect ( resolveThemeApi ( app , app . options . theme ) . layouts ) . toEqual ( { } )
15+ expect ( resolveThemeInfo ( app , app . options . theme ) . layouts ) . toEqual ( { } )
1616 } )
1717
18- it ( 'should resolve theme api with layouts correctly' , ( ) => {
18+ it ( 'should resolve theme info with layouts correctly' , ( ) => {
1919 const app = createBaseApp ( {
2020 source : path . resolve ( __dirname , 'fake-source' ) ,
2121 theme : fixtures ( 'themes/has-layouts.js' ) ,
2222 } )
2323
24- expect ( resolveThemeApi ( app , app . options . theme ) . layouts ) . toEqual ( {
24+ expect ( resolveThemeInfo ( app , app . options . theme ) . layouts ) . toEqual ( {
2525 Layout : fixtures ( 'layouts/Layout.vue' ) ,
2626 404 : fixtures ( 'layouts/404.vue' ) ,
2727 } )
2828 } )
2929 } )
3030
3131 describe ( 'plugins' , ( ) => {
32- it ( 'should resolve theme api without plugins correctly' , ( ) => {
32+ it ( 'should resolve theme info without plugins correctly' , ( ) => {
3333 const app = createBaseApp ( {
3434 source : path . resolve ( __dirname , 'fake-source' ) ,
3535 theme : fixtures ( 'themes/empty.js' ) ,
3636 } )
3737
38- expect ( resolveThemeApi ( app , app . options . theme ) . plugins ) . toEqual ( [
38+ expect ( resolveThemeInfo ( app , app . options . theme ) . plugins ) . toEqual ( [
3939 require ( fixtures ( 'themes/empty.js' ) ) ,
4040 ] )
4141 } )
4242
43- it ( 'should resolve theme api with plugins correctly' , ( ) => {
43+ it ( 'should resolve theme info with plugins correctly' , ( ) => {
4444 const app = createBaseApp ( {
4545 source : path . resolve ( __dirname , 'fake-source' ) ,
4646 theme : fixtures ( 'themes/has-plugins.js' ) ,
4747 } )
4848
49- expect ( resolveThemeApi ( app , app . options . theme ) . plugins ) . toEqual ( [
49+ expect ( resolveThemeInfo ( app , app . options . theme ) . plugins ) . toEqual ( [
5050 require ( fixtures ( 'themes/has-plugins.js' ) ) ,
5151 require ( fixtures ( 'plugins/obj.js' ) ) ,
5252 ] )
5353 } )
5454 } )
5555
5656 describe ( 'extends' , ( ) => {
57- it ( 'should resolve theme api with parent theme correctly' , ( ) => {
57+ it ( 'should resolve theme info with parent theme correctly' , ( ) => {
5858 const app = createBaseApp ( {
5959 source : path . resolve ( __dirname , 'fake-source' ) ,
6060 theme : fixtures ( 'themes/extends-parent.js' ) ,
6161 } )
6262
63- expect ( resolveThemeApi ( app , app . options . theme ) ) . toEqual ( {
63+ expect ( resolveThemeInfo ( app , app . options . theme ) ) . toEqual ( {
6464 plugins : [
6565 require ( fixtures ( 'themes/has-layouts-and-plugins.js' ) ) ,
6666 require ( fixtures ( 'plugins/obj.js' ) ) ,
@@ -75,13 +75,13 @@ describe('core > app > resolveThemeApi', () => {
7575 } )
7676 } )
7777
78- it ( 'should resolve theme api with grandparent theme correctly' , ( ) => {
78+ it ( 'should resolve theme info with grandparent theme correctly' , ( ) => {
7979 const app = createBaseApp ( {
8080 source : path . resolve ( __dirname , 'fake-source' ) ,
8181 theme : fixtures ( 'themes/extends-grandparent.js' ) ,
8282 } )
8383
84- expect ( resolveThemeApi ( app , app . options . theme ) ) . toEqual ( {
84+ expect ( resolveThemeInfo ( app , app . options . theme ) ) . toEqual ( {
8585 plugins : [
8686 require ( fixtures ( 'themes/has-layouts-and-plugins.js' ) ) ,
8787 require ( fixtures ( 'plugins/obj.js' ) ) ,
0 commit comments