File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ define.app({
6666 ) ;
6767
6868 execCliAsync ( 'dev --config test-temp-import.config.ts' ) ;
69- await logHelper . expectLog ( 'built in' ) ;
69+ await logHelper . expectBuildEnd ( ) ;
7070 logHelper . clearLogs ( ) ;
7171
7272 await writeFile ( importedFile , '// changed\n' ) ;
Original file line number Diff line number Diff line change 11import { type ChildProcess , type SpawnOptions , spawn as nodeSpawn } from 'node:child_process' ;
22import path from 'node:path' ;
3- import {
4- type ExtendedLogHelper ,
5- prepareDist as basePrepareDist ,
6- proxyConsole ,
7- } from '@rstackjs/test-utils' ;
3+ import { prepareDist as basePrepareDist } from '@rstackjs/test-utils' ;
84import { test as baseTest } from 'rstack/test' ;
95import { execCli as baseExecCli , type ExecCli , RSTACK_BIN_PATH } from './cli.ts' ;
6+ import { type ExtendedLogHelper , proxyConsole } from './logs.ts' ;
107
118type Exec = (
129 command : string ,
Original file line number Diff line number Diff line change 1+ export const BUILD_END_LOG = 'built in' ;
Original file line number Diff line number Diff line change 11export * from './cli.ts' ;
22export * from './cliTest.ts' ;
3+ export * from './constants.ts' ;
Original file line number Diff line number Diff line change 1+ import {
2+ type ExtendedLogHelper as BaseExtendedLogHelper ,
3+ type LogHelper as BaseLogHelper ,
4+ proxyConsole as baseProxyConsole ,
5+ type ProxyConsoleOptions ,
6+ } from '@rstackjs/test-utils' ;
7+ import { BUILD_END_LOG } from './constants.ts' ;
8+
9+ type ExpectBuildEnd = {
10+ expectBuildEnd : ( ) => Promise < boolean > ;
11+ } ;
12+
13+ export type LogHelper = BaseLogHelper & ExpectBuildEnd ;
14+
15+ export type ExtendedLogHelper = BaseExtendedLogHelper & ExpectBuildEnd ;
16+
17+ export const proxyConsole = ( options ?: ProxyConsoleOptions ) : ExtendedLogHelper => {
18+ const logHelper = baseProxyConsole ( options ) ;
19+
20+ return {
21+ ...logHelper ,
22+ expectBuildEnd : async ( ) => logHelper . expectLog ( BUILD_END_LOG ) ,
23+ } ;
24+ } ;
You can’t perform that action at this time.
0 commit comments