oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
71.73k stars 2.55k forks source link

Allow `test.skip()` to be called without a function #11857

Open kossnocorp opened 2 weeks ago

kossnocorp commented 2 weeks ago

What version of Bun is running?

1.1.13+bd6a60512

What platform is your computer?

Linux 5.15.153.1-microsoft-standard-WSL2 x86_64 x86_64

What steps can reproduce the bug?

git clone git@github.com:date-fns/date-fns.git
bun ./scripts/test/tzOffset.ts

What is the expected behavior?

Before upgrading, the tests would show the results:

image,

What do you see instead?

Now, it gives a cryptic error on the same setup:

image

Additional information

There's error handling, Bun doesn't get to it:

image

Here's what the stderr contains:

image

I reckon Bun changed the it.skip behavior, but it seems like a separate issue, as the error should've been properly handled unless I'm missing something.

Electroid commented 2 weeks ago

Between v1.1.8 and v1.1.13 we fixed a bug in bun test where errors that were thrown between tests were not reported. Thus, this error was always being thrown, it just never printed until now and will also fail the test suite.

That said, the behaviour of test/it.skip has not changed. There's a separate question which is: should we allow you to define test.skip with just a message? Maybe, it seems reasonable.

kossnocorp commented 2 weeks ago

@Electroid thank you for your answer. However, I feel like Bun is still misbehaves:

image

Here, it proceeded with the correct exit code and stderr instead of throwing an exception, or I'm missing something?