Skip to content

ts-transformer-keys not working since 26.4.2 (works in 26.4.1) #2073

@DamianPereira

Description

@DamianPereira

🐛 Bug Report

ts-transformer-keys shows the following error when running any test that uses it:

    ReferenceError: ts_transformer_keys_1 is not defined

       6 | export default class TestClass {
       7 |   testMethod(){
    >  8 |     keys();
         |     ^
       9 |     const fooKeys = keys<Foo>();
      10 |     return fooKeys
      11 |   }

To Reproduce

Steps to reproduce the behavior:

  1. Clone ts-transformer-keys repository: https://github.com/kimamula/ts-transformer-keys/
  2. go to examples/ts-jest
  3. Switch from version 26.3.0 to 26.4.2 (versions up to 26.4.1 work correctly, 26.4.2 is the first failing one)
  4. Optionally update syntax in jest.config.js to an object with before key instead of straight array to solve deprecation warning (has no effect on error above)
  5. Run npm install
  6. Run npm start

Expected behavior

Tests should pass and keys function from keys transformer should be made available to the code.

Debug log:

# content of ts-jest.log (file are too big, saved to 2 gists):
26.4.2 (failing): https://gist.github.com/DamianPereira/194e33d29411e36c1c221da44d07b38d
26.4.1 (working): https://gist.github.com/DamianPereira/eab246c2daef2c337fdc90859e8bf551

envinfo

System:
    OS: Manjaro linux
    Node version: 14.3.0

Npm packages:
    jest: 26.4.2
    ts-jest: 26.4.2
    typescript: 4.0.2

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions