test: making the rebuild tests stable

This commit is contained in:
Zoltan Kochan
2025-12-23 13:01:47 +01:00
parent 3bf5e218a6
commit 05d8a71bae

View File

@@ -244,10 +244,13 @@ test('rebuild with pending option', async () => {
])
let modules = project.readModulesManifest()
expect(modules!.pendingBuilds).toStrictEqual([
'@pnpm.e2e/pre-and-postinstall-scripts-example@1.0.0',
'install-scripts-example-for-pnpm@https://codeload.github.com/pnpm-e2e/install-scripts-example/tar.gz/b6cfdb8af6f8d5ebc5e7de6831af9d38084d765b',
])
expect(modules!.pendingBuilds).toHaveLength(2)
expect(modules!.pendingBuilds[0]).toBe('@pnpm.e2e/pre-and-postinstall-scripts-example@1.0.0')
// We are not doing an exact match here because when we hit rate limits, sometimes it gets resolved to
// install-scripts-example-for-pnpm@git+https://github.com/pnpm-e2e/install-scripts-example.git#b6cfdb8af6f8d5ebc5e7de6831af9d38084d765b
// not to
// install-scripts-example-for-pnpm@https://codeload.github.com/pnpm-e2e/install-scripts-example/tar.gz/b6cfdb8af6f8d5ebc5e7de6831af9d38084d765b
expect(modules!.pendingBuilds[1]).toMatch(/^install-scripts-example-for-pnpm@.*b6cfdb8af6f8d5ebc5e7de6831af9d38084d765b.*/)
project.hasNot('@pnpm.e2e/pre-and-postinstall-scripts-example/generated-by-preinstall')
project.hasNot('@pnpm.e2e/pre-and-postinstall-scripts-example/generated-by-postinstall')