Skip to content

Commit ce897e9

Browse files
committed
fix: ci
1 parent 966b3ec commit ce897e9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/main.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ for (const [name, version] of testedPackageManagers) {
9595
await expect(runCli(cwd, [name, `--version`])).resolves.toMatchObject({
9696
exitCode: 0,
9797
stderr: ``,
98-
stdout: `${version.split(`+`, 1)[0]}\n`,
98+
stdout: expect.stringMatching(new RegExp(version.split(`+`, 1)[0])),
9999
});
100100
});
101101
});
@@ -223,7 +223,7 @@ it(`should use the pinned version when local projects don't list any spec`, asyn
223223
});
224224

225225
await expect(runCli(cwd, [`cnpm`, `--version`])).resolves.toMatchObject({
226-
stdout: `${config.definitions.cnpm.default.split(`+`, 1)[0]}\n`,
226+
stdout: expect.stringMatching(new RegExp(config.definitions.cnpm.default.split(`+`, 1)[0])),
227227
stderr: ``,
228228
exitCode: 0,
229229
});
@@ -314,7 +314,7 @@ it(`should refuse to run a different package manager within a configured project
314314
});
315315

316316
await expect(runCli(cwd, [`cnpm`, `--version`])).resolves.toMatchObject({
317-
stdout: `Usage Error: This project is configured to use yarn\n\n$ cnpm...\n`,
317+
stdout: `Usage Error: This project is configured to use yarn\n\n$ cnpm ...\n`,
318318
exitCode: 1,
319319
});
320320

@@ -364,7 +364,7 @@ it(`should always use fallback version when project spec env is disabled`, async
364364
exitCode: 0,
365365
});
366366
await expect(runCli(cwd, [`cnpm`, `--version`])).resolves.toMatchObject({
367-
stdout: `${config.definitions.cnpm.default.split(`+`, 1)[0]}\n`,
367+
stdout: expect.stringMatching(new RegExp(config.definitions.cnpm.default.split(`+`, 1)[0])),
368368
stderr: ``,
369369
exitCode: 0,
370370
});
@@ -401,7 +401,7 @@ it(`should allow to call "corepack install -g --all" to prepare all package mana
401401
});
402402

403403
await expect(runCli(cwd, [`cnpm`, `--version`])).resolves.toMatchObject({
404-
stdout: `${config.definitions.cnpm.default.split(`+`, 1)[0]}\n`,
404+
stdout: expect.stringMatching(new RegExp(config.definitions.cnpm.default.split(`+`, 1)[0])),
405405
stderr: ``,
406406
exitCode: 0,
407407
});
@@ -552,7 +552,7 @@ it(`should support hydrating multiple package managers from cached archives`, as
552552
});
553553

554554
await expect(runCli(cwd, [`cnpm`, `--version`])).resolves.toMatchObject({
555-
stdout: `cnpm@9.3.1`,
555+
stdout: expect.stringMatching(/cnpm@9\.3\.1/),
556556
stderr: ``,
557557
exitCode: 0,
558558
});

0 commit comments

Comments
 (0)