This repository was archived by the owner on Apr 11, 2024. It is now read-only.
File tree 2 files changed +2
-8
lines changed
2 files changed +2
-8
lines changed File renamed without changes.
Original file line number Diff line number Diff line change 1
1
const { promisify } = require ( 'es6-promisify' ) ;
2
2
const rimrafAsync = promisify ( require ( 'rimraf' ) ) ;
3
3
const path = require ( 'path' ) ;
4
- const getPort = require ( 'get-port' ) ;
5
- const serve = require ( 'serve' ) ;
6
4
const { exec } = require ( 'child-process-promise' ) ;
7
5
const dirContentsToObject = require ( '../_utils/dirContentsToObject' ) ;
8
6
9
7
const distPath = path . join ( __dirname , 'dist' ) ;
10
- const servePath = path . join ( __dirname , 'serve-me' ) ;
11
8
12
9
beforeEach ( ( ) => rimrafAsync ( distPath ) ) ;
13
10
14
11
test ( 'url' , async ( ) => {
15
- const port = await getPort ( ) ;
16
- const server = serve ( servePath , { port, silent : true } )
12
+ const url = `file://${ path . join ( __dirname , 'index.html' ) } ` ;
17
13
18
- await exec ( `node ../../bin/cli --puppeteer-args="--no-sandbox --disable-setuid-sandbox" --out-dir dist --url http://localhost:${ port } ` , { cwd : __dirname } ) ;
19
-
20
- server . stop ( ) ;
14
+ await exec ( `node ../../bin/cli --puppeteer-args="--no-sandbox --disable-setuid-sandbox" --out-dir dist --url ${ url } ` , { cwd : __dirname } ) ;
21
15
22
16
const output = await dirContentsToObject ( distPath ) ;
23
17
expect ( output ) . toMatchSnapshot ( ) ;
You can’t perform that action at this time.
0 commit comments