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

Use @jest/globals for autogenerated spec files #1942

Closed
1 task done
Yehonal opened this issue Feb 21, 2023 · 1 comment
Closed
1 task done

Use @jest/globals for autogenerated spec files #1942

Yehonal opened this issue Feb 21, 2023 · 1 comment
Labels

Comments

@Yehonal
Copy link

Yehonal commented Feb 21, 2023

Is there an existing issue that is already proposing this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe it

Jest supports the injectGlobals option that disables the injections of the variables (jest, describe, expect etc.) into the global, once you disable this, the autogenerated Nestjs file doesn't work anymore

Describe the solution you'd like

We should add this line to the generated file:

import { beforeEach, describe, expect, it } from '@jest/globals';

This is going to work in any situation, with or without the injectGlobals

Teachability, documentation, adoption, migration strategy

No response

What is the motivation / use case for changing the behavior?

We want to make sure that NestJS is compatible with the new versions of the tools its using

@kamilmysliwiec
Copy link
Member

Let's track this here nestjs/schematics#1324

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants