mdrobbins's avatar

Failing test in PhpStorm does not show the error

I'm using pest and running a test that I expect to fail because of an exception (think TDD), when I run that test in the PhpStorm test runner, it only shows "The test did not perform any assertions". If I run the test from the command line, I'll see the error that I expect. For example, with this code:

it('should fail', function() {
    $test = FakeModel::factory()->create();
});

Running in PhpStorm results in 1 failed, ignored, "This test did not perform any assertions".

Running from the pest command-line results in 1 failed, "Class "FakeModel" not found" as expected.

This is a newer project with pest 2.5.3. I've got an older project with pest 1.22.0 and running the test in PhpStorm works as expected.

Any ideas about why I'm not seeing these errors in PhpStorm?

0 likes
3 replies
ahoi's avatar

Got the same problem here. It's kinda annoying.

Did you find a solution, @mdrobbins ?

mdrobbins's avatar

I haven't yet. It's really weird. I only have this issue in one project. Previous projects work fine and if I create a new, empty project it works. I've deleted my vendor directory and re-run composer. I've copied composer.json and phpunit.xml from a project that works to this one, still nothing. I've even deleted the .idea folder to reset the editor.

I opened a support case with JetBrains and they suggested opening an issue with the Pest plugin team on GitHub. I haven't done that yet since I can't reproduce the issue in any other project.

Please or to participate in this conversation.