File tree Expand file tree Collapse file tree
test/fixtures/example-ts-cluster/test Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99jobs :
1010 Job :
1111 name : Node.js
12- uses : node-modules/github-actions/.github/workflows/node-test-parallel.yml@test-parallel
12+ uses : node-modules/github-actions/.github/workflows/node-test-parallel.yml@master
1313 with :
1414 os : ' ubuntu-latest, macos-latest, windows-latest'
1515 version : ' 18, 20, 22'
1616 parallel : 2
17- action_ref : ' test-parallel'
1817 secrets :
1918 CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
Original file line number Diff line number Diff line change 1+ import { scheduler } from 'node:timers/promises' ;
12import mm , { MockOption } from '@eggjs/mock' ;
23import request from 'supertest' ;
34
4- describe ( 'test/index.test.ts' , ( ) => {
5+ describe ( 'example-ts-cluster/ test/index.test.ts' , ( ) => {
56 let app : any ;
6- before ( ( ) => {
7+ before ( async ( ) => {
78 app = mm . cluster ( {
89 opt : {
910 execArgv : [ '--require' , 'ts-node/register' ] ,
1011 } ,
1112 } as MockOption ) ;
12- // app.debug();
13- return app . ready ( ) ;
13+ app . debug ( ) ;
14+ await app . ready ( ) ;
15+ await scheduler . wait ( 1000 ) ;
1416 } ) ;
1517
1618 after ( ( ) => app . close ( ) ) ;
1719 it ( 'should work' , async ( ) => {
18- const req = request ( `http://127.0.0.1:${ app . port } ` ) ;
19- return req
20+ const url = `http://127.0.0.1:${ app . port } ` ;
21+ console . log ( 'request %s' , url ) ;
22+ await request ( url )
2023 . get ( '/' )
2124 . expect ( 'hi, egg' )
2225 . expect ( 200 ) ;
You can’t perform that action at this time.
0 commit comments