Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.4.0 breaks usage with globals: true #9

Closed
hco opened this issue May 9, 2023 · 4 comments
Closed

0.4.0 breaks usage with globals: true #9

hco opened this issue May 9, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@hco
Copy link

hco commented May 9, 2023

Bug description

I just introduced vitest-fail-on-console in a project, and it did not make any tests fail even though there was console output.
As I checked the repo, I noticed that 0.4.0 was just released, and verified if 0.3.1 works - and yep, with 0.3.1 the tests fail.

If you need a repo for reproduction, let me know, I can try to set one up :)

@hco hco added the bug Something isn't working label May 9, 2023
@thomasbrodusch
Copy link
Owner

Hi, @hco thanks for your interest in vitest-fail-on-console!

I cannot reproduce that kind of behavior, I've just made the check according to what you've just said) using examples/; everything seems to work with globals: true and no globals in vitest.config.js.

Can you provide me a repo to have a look at it (maybe there is a mismatch in your configuration or something)

@JarvisH
Copy link

JarvisH commented Jul 4, 2023

It works when importing the relevant files directly from the "src" folder (like in the examples), but when importing from node modules it does not work:

import failOnConsole from 'vitest-fail-on-console'

// does nothing
failOnConsole()

@jamesdh
Copy link

jamesdh commented Jul 7, 2023

Just ran into this as well. v0.3.1 works as expected, v0.4.1 does not detect the console warnings.

Related to #8

@thomasbrodusch thomasbrodusch self-assigned this Jul 22, 2023
thomasbrodusch added a commit that referenced this issue Jul 22, 2023
* remove nodePolyfills
* update examples/ import
@thomasbrodusch
Copy link
Owner

thomasbrodusch commented Jul 22, 2023

Hi @hco @JarvisH and @jamesdh, thanks for your insights about this issue.
I've just published a patch v0.4.2 available on NPM.

Have a try and tell me if everything is OK on your side!
Thanks a lot to use vitest-fail-on-console

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants