Nx: Updating to ts-jest 26.2.0 causes (WARN) The configuration for astTransformers as string[] is deprecated and will be removed in ts-jest 27

Created on 11 Aug 2020  路  1Comment  路  Source: nrwl/nx

When upgrading ts-jest to 26.2.0 it starts complaining about astTransformers needing to be an object.
https://kulshekhar.github.io/ts-jest/user/config/astTransformers

The solution should be changing all jest.config.js files to use the new syntax.
but I'm not sure if we should use before, after or afterDeclarations.

// jest.config.js
module.exports = {
  // [...]
  globals: {
    'ts-jest': {
      astTransformers: {
        before: [
          'jest-preset-angular/build/InlineFilesTransformer',
          'jest-preset-angular/build/StripStylesTransformer',
        ],
      },
    }
  }
};

Expected Behavior

tests should run without errors being displayed.

Steps to Reproduce

update ts-jest to 26.2.0
run tests

angular bug

Most helpful comment

We are working to officially support updating to Jest 26 in an upcoming release

>All comments

We are working to officially support updating to Jest 26 in an upcoming release

Was this page helpful?
0 / 5 - 0 ratings