Skip to content

JestBuilder not respect globals properties defined in jest.config.js #1059

@kklimczak

Description

@kklimczak

Expected Behavior

Properties defined in globals property inside jest.config.js should be available in jest context.

Current Behavior

At this moment globals is ignored because here JestBuilder set own globals settings so Jest ignores settings from jest.config.js.
This behavior occures when I run tests via ng test. When I run as jest or inside WebStorm IDE tests work fine.

Failure Information (for bugs)

I set enableTsDiagnostics property to enable type-checking inside my tests, but it's not work.

Steps to Reproduce

  1. Init nx workspace with cli,
  2. Add test lib,
  3. Add class (g.e. test) to lib with one param in costructor,
  4. Create spec file for above class and call constructor without param.
  5. Run tests via ng test.

Context

Please provide any relevant information about your setup:

  • version of Nx used - 7.5.1
  • version of Angular CLI used - 7.2.4
  • angular.json configuration
  • version of Angular DevKit used - 0.11.2
  • 3rd-party libraries and their versions -> package.json
  • and most importantly - a use-case that fails

I prepare repo with bug reproduction. In my case I'd like to enable type checking in ts-jest so I need to set enableTsDiagnostics flag to true.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions