@@ -2,7 +2,7 @@ import puppeteer from 'puppeteer'
22// TODO
33// const pti = require('puppeteer-to-istanbul')
44// const { copyFile } = require('fs').promises
5- import { log , error , logRaw , logWrite } from './log.js'
5+ import { log , error , logRaw , logWrite , flushLogs } from './log.js'
66
77// wrap our convoluted _run() function in a pure Promise that can handle
88// both standard throws and the callback that ends it. _run() needs to handle
@@ -42,6 +42,7 @@ async function _run (outputDir, port, timeout, mode, runner, coverage, callback)
4242 return
4343 }
4444 executionQueue . then ( async ( ) => {
45+ flushLogs ( true )
4546 executionQueue = null
4647 /* TODO
4748 if (coverage) {
@@ -71,7 +72,7 @@ async function _run (outputDir, port, timeout, mode, runner, coverage, callback)
7172 }
7273 const args = [ ]
7374 executionQueue = executionQueue . then ( async ( ) => {
74- logRaw ( 'info' , await Promise . all ( args ) )
75+ logRaw ( 'info' , - 1 , await Promise . all ( args ) )
7576 } )
7677 for ( const arg of msg . args ( ) ) {
7778 args . push ( arg . evaluate ( n => n ) )
@@ -86,7 +87,7 @@ async function _run (outputDir, port, timeout, mode, runner, coverage, callback)
8687 end ( errors )
8788 } )
8889 await page . exposeFunction ( 'polendinaLog' , ( args ) => {
89- logRaw ( args . shift ( ) , args )
90+ logRaw ( args . shift ( ) , args . shift ( ) , args )
9091 maybeEnd ( )
9192 } )
9293 await page . exposeFunction ( 'polendinaWrite' , ( args ) => {
0 commit comments