Skip to content

Use @jest/globals for autogenerated spec filesΒ #1942

@Yehonal

Description

@Yehonal

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions