Skip to content

Commit

Permalink
fix: ci
Browse files Browse the repository at this point in the history
  • Loading branch information
elrrrrrrr committed Dec 7, 2023
1 parent 966b3ec commit ce897e9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ for (const [name, version] of testedPackageManagers) {
await expect(runCli(cwd, [name, `--version`])).resolves.toMatchObject({
exitCode: 0,
stderr: ``,
stdout: `${version.split(`+`, 1)[0]}\n`,
stdout: expect.stringMatching(new RegExp(version.split(`+`, 1)[0])),
});
});
});
Expand Down Expand Up @@ -223,7 +223,7 @@ it(`should use the pinned version when local projects don't list any spec`, asyn
});

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

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

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

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

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

0 comments on commit ce897e9

Please sign in to comment.