11import { WriteStreamsMock } from "../../../src/write-streams.js" ;
22import { handler } from "../../../src/handler.js" ;
3- import chalk from "chalk-template" ;
43import { initSpawnSpy } from "../../mocks/utils.mock.js" ;
54import { WhenStatics } from "../../mocks/when-statics.js" ;
65import fs from "fs-extra" ;
@@ -17,14 +16,11 @@ test("extra-host <test-job>", async () => {
1716 extraHost : [ "fake-google.com:142.250.185.206" ] ,
1817 } , writeStreams ) ;
1918
20- const expected = [
21- chalk `{blueBright test-job} {greenBright >} HTTP/1.1 404 Not Found` ,
22- ] ;
23- expect ( writeStreams . stdoutLines ) . toEqual ( expect . arrayContaining ( expected ) ) ;
19+ expect ( writeStreams . stdoutLines . join ( "\n" ) ) . toMatch ( / 1 4 2 \. 2 5 0 \. 1 8 5 \. 2 0 6 / ) ;
2420} ) ;
2521
2622test ( "extra-host <service-job>" , async ( ) => {
27- await fs . promises . rm ( "tests/test-cases/extra-host/.gitlab-ci-local/services-output/service-job/docker.io/alpine:latest -0.log" , { force : true } ) ;
23+ await fs . promises . rm ( "tests/test-cases/extra-host/.gitlab-ci-local/services-output/service-job/docker.io/alpine:3.21 -0.log" , { force : true } ) ;
2824
2925 const writeStreams = new WriteStreamsMock ( ) ;
3026 await handler ( {
@@ -34,6 +30,6 @@ test("extra-host <service-job>", async () => {
3430 } , writeStreams ) ;
3531
3632 expect ( writeStreams . stdoutLines . join ( "\n" ) ) . toMatch ( / t r u e / ) ;
37- expect ( await fs . pathExists ( "tests/test-cases/extra-host/.gitlab-ci-local/services-output/service-job/docker.io/alpine:latest -0.log" ) ) . toEqual ( true ) ;
38- expect ( await fs . readFile ( "tests/test-cases/extra-host/.gitlab-ci-local/services-output/service-job/docker.io/alpine:latest -0.log" , "utf-8" ) ) . toMatch ( / 1 4 2 .2 5 0 .1 8 5 .2 0 6 / ) ;
33+ expect ( await fs . pathExists ( "tests/test-cases/extra-host/.gitlab-ci-local/services-output/service-job/docker.io/alpine:3.21 -0.log" ) ) . toEqual ( true ) ;
34+ expect ( await fs . readFile ( "tests/test-cases/extra-host/.gitlab-ci-local/services-output/service-job/docker.io/alpine:3.21 -0.log" , "utf-8" ) ) . toMatch ( / 1 4 2 .2 5 0 .1 8 5 .2 0 6 / ) ;
3935} ) ;
0 commit comments