File tree Expand file tree Collapse file tree 1 file changed +27
-1
lines changed
packages/@vue/cli-service/__tests__ Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Original file line number Diff line number Diff line change 1
- jest . setTimeout ( 30000 )
1
+ jest . setTimeout ( 45000 )
2
2
3
3
const { defaultPreset } = require ( '@vue/cli/lib/options' )
4
4
const create = require ( '@vue/cli-test-utils/createTestProject' )
@@ -46,3 +46,29 @@ test('serve with router', async () => {
46
46
}
47
47
)
48
48
} )
49
+
50
+ test ( 'serve with inline entry' , async ( ) => {
51
+ const project = await create ( 'e2e-serve-inline-entry' , defaultPreset )
52
+
53
+ const path = require ( 'path' )
54
+ const fs = require ( 'fs-extra' )
55
+ await fs . move (
56
+ path . resolve ( project . dir , 'src/main.js' ) ,
57
+ path . resolve ( project . dir , 'src/index.js' )
58
+ )
59
+
60
+ await serve (
61
+ ( ) => project . run ( 'vue-cli-service serve src/index.js' ) ,
62
+ async ( { nextUpdate, helpers } ) => {
63
+ const msg = `Welcome to Your Vue.js App`
64
+ expect ( await helpers . getText ( 'h1' ) ) . toMatch ( msg )
65
+
66
+ // test hot reload
67
+ const file = await project . read ( `src/App.vue` )
68
+ project . write ( `src/App.vue` , file . replace ( msg , `Updated` ) )
69
+ await nextUpdate ( ) // wait for child stdout update signal
70
+ await sleep ( 1000 ) // give the client time to update
71
+ expect ( await helpers . getText ( 'h1' ) ) . toMatch ( `Updated` )
72
+ }
73
+ )
74
+ } )
You can’t perform that action at this time.
0 commit comments