@@ -14,7 +14,8 @@ async function makeProjectMultiPage (project) {
14
14
pages: {
15
15
index: { entry: 'src/main.js' },
16
16
foo: { entry: 'src/foo.js' },
17
- bar: { entry: 'src/bar.js' }
17
+ bar: { entry: 'src/bar.js' },
18
+ foobar: { entry: 'src/foobar.js' }
18
19
},
19
20
chainWebpack: config => {
20
21
const splitOptions = config.optimization.get('splitChunks')
@@ -39,6 +40,13 @@ async function makeProjectMultiPage (project) {
39
40
render: h => h(App)
40
41
})
41
42
` )
43
+ await project . write ( 'src/foobar.js' , `
44
+ import Vue from 'vue'
45
+ new Vue({
46
+ el: '#app',
47
+ render: h => h('h1', 'FooBar')
48
+ })
49
+ ` )
42
50
const app = await project . read ( 'src/App.vue' )
43
51
await project . write ( 'src/App.vue' , app . replace (
44
52
`import HelloWorld from './components/HelloWorld.vue'` ,
@@ -61,6 +69,15 @@ test('serve w/ multi page', async () => {
61
69
62
70
await page . goto ( `${ url } /bar.html` )
63
71
expect ( await helpers . getText ( 'h1' ) ) . toMatch ( `Welcome to Your Vue.js App` )
72
+
73
+ await page . goto ( `${ url } foo` )
74
+ expect ( await helpers . getText ( 'h1' ) ) . toMatch ( `Foo` )
75
+
76
+ await page . goto ( `${ url } bar` )
77
+ expect ( await helpers . getText ( 'h1' ) ) . toMatch ( `Welcome to Your Vue.js App` )
78
+
79
+ await page . goto ( `${ url } foobar` )
80
+ expect ( await helpers . getText ( 'h1' ) ) . toMatch ( `FooBar` )
64
81
}
65
82
)
66
83
} )
0 commit comments