Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: tsconfig compilerOptions#target not being respected in v28 #3822

Closed
barbados-clemens opened this issue Sep 20, 2022 · 1 comment
Closed
Labels
Not An Issue Not ts-jest issue

Comments

@barbados-clemens
Copy link

Version

28.0.8

Steps to reproduce

  1. Clone https://github.com/FrozenPandaz/nx-examples
  2. checkout branch repro11975
  3. run yarn nx test products and see error Exponentiation cannot be performed on 'bigint' values unless the 'target' option is set to 'es2016' or later. for app.component.spec.ts

Expected behavior

following the error
Exponentiation cannot be performed on 'bigint' values unless the 'target' option is set to 'es2016' or later. would allow for the tests to pass

it('should handle BigInt', () => {
  const result = BigInt(2) ** BigInt(33);
  expect(result).toBeTruthy();
});

Actual behavior

updating tsconfig compilerOptions#target does not change the test behavior

Debug log

running with this flag didn't produce any log files :(

Additional context

related original nx issue: nrwl/nx#11975
potentially related ts-jest issue: #3328

I can see the raw parsed tsconfig having the property

raw: {
    extends: './tsconfig.json',
    compilerOptions: {
      outDir: '../../dist/out-tsc',
      module: 'commonjs',
      lib: [Array],
      types: [Array],
      target: 'es2020'
    },
    files: [ 'src/test-setup.ts' ],
    include: [ '**/*.spec.ts', '**/*.test.ts', '**/*.d.ts', 'jest.config.ts' ],
    compileOnSave: false,
    exclude: [ '../../node_modules', '../../tmp' ]
  },
  errors: [],
  wildcardDirectories: { '/users/caleb/work/frozenpandaz/nx-examples/apps/products': 1 },
  compileOnSave: false

parsed shows target:2 in the configSet.parsedTsConfig.options,

I can only assume is the same as the raw but unsure, maybe this is an issue??

Environment

System:
    OS: macOS 12.6
    CPU: (10) arm64 Apple M1 Max
  Binaries:
    Node: 16.15.0 - ~/.nvm/versions/node/v16.15.0/bin/node
    Yarn: 1.22.15 - ~/.nvm/versions/node/v16.15.0/bin/yarn
    npm: 8.5.5 - ~/.nvm/versions/node/v16.15.0/bin/npm
  npmPackages:
    jest: 28.1.3 => 28.1.3
@ahnpnl
Copy link
Collaborator

ahnpnl commented Sep 25, 2022

This is a bug with jest-preset-angular. You can check the related PR.

@ahnpnl ahnpnl closed this as completed Sep 25, 2022
@ahnpnl ahnpnl added the Not An Issue Not ts-jest issue label Sep 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Not An Issue Not ts-jest issue
Projects
None yet
Development

No branches or pull requests

2 participants