Skip to content

[Bug]: Getting ReferenceError when using decorators #1810

@philippesc

Description

@philippesc

Version

12.2.2

Steps to reproduce

  1. Clone my repo at https://github.com/philippesc/ng-jest-issue
  2. yarn install
  3. yarn test
  4. You should see the error come up

Expected behavior

I expect that no error comes up as the test should work properly.

Actual behavior

This is what comes up:

ReferenceError: app_state_model_1 is not defined

   5 | export class AppSelectors {
   6 |   @Selector([AppState])
>  7 |   static appName(state: AppStateModel): string {
     |                         ^
   8 |     return state.name;
   9 |   }
  10 | }

  at Object.<anonymous> (src/app/store/app/app.selectors.ts:7:25)
  at Object.<anonymous> (src/app/services/some-nice-service/some-nice-service.spec.ts:3:1)

Additional context

This error came up in the context of migration to Angular 14 but it seems to be related to this package.

Environment

System:
  OS: macOS 12.6
  CPU: (10) arm64 Apple M1 Max
Binaries:
  Node: 16.13.1 - /usr/local/bin/node
  Yarn: 1.22.17 - /usr/local/bin/yarn
  npm: 8.3.0 - /usr/local/bin/npm
npmPackages:
  jest: 28.1.1 => 28.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions