diff --git a/packages/php-wasm/node/src/test/php.spec.ts b/packages/php-wasm/node/src/test/php.spec.ts index 7d48dec2de..1063f9d17a 100644 --- a/packages/php-wasm/node/src/test/php.spec.ts +++ b/packages/php-wasm/node/src/test/php.spec.ts @@ -922,37 +922,42 @@ describe.each(SupportedPHPVersions)('PHP %s', (phpVersion) => { )) { // Run via `code` it(testName, async () => { - const result = await php.run({ + const promise = php.run({ code: testSnippet, }); - expect(result.exitCode).toBeGreaterThan(0); + await expect(promise).rejects.toThrow(); }); // Run via the request handler it(testName, async () => { php.writeFile('/test.php', testSnippet); - const result = await php.run({ + const promise = php.run({ scriptPath: '/test.php', }); - expect(result.exitCode).toBeGreaterThan(0); + await expect(promise).rejects.toThrow(); }); } }); it('Returns the correct exit code on subsequent runs', async () => { - const result1 = await php.run({ + const promise1 = php.run({ code: '