Ts-jest: v23 does not support "extends" (TS6096)

Created on 18 Jul 2018  路  8Comments  路  Source: kulshekhar/ts-jest

  • Issue

I have a tsconfig.json that uses the extends property:

{
  "extends": "../tsconfig",
  "compilerOptions": {
    "module": "CommonJS",
    "removeComments": false,
    "resolveJsonModule": false,
  }
}

Using ts-jest v23 the following error is thrown:

Some errors occurred while attempting to read from /Users/mattyclarkson/git/github/ef-carbon/url/test/tsconfig.json: message TS6096: File '../tsconfig' does not exist.

Works with v22.

  • Expected behavior

Should allow extended configurations

  • Output from your debug log

No Output

  • Link to a minimal repo that reproduces this issue

https://github.com/ef-carbon/url

  • Optional (but highly recommended) - Configure Travis (or your favorite system) with the minimal repo

CircleCI is working on the repository

Most helpful comment

@mattyclarkson it is fixed in 23.1.2, just checked:
screen shot 2018-08-04 at 07 56 39

All 8 comments

Try replacing "extends": "../tsconfig" with "extends": "../tsconfig.json" (notice the .json at the end)

I also noticed this when upgrading from 22.4.6 to 23. I think there must be something in v23 that breaks this extend. I think we should check why this is broken but not in 22.4.6

@ahnpnl have to check, but if TS moved from a require() to a readFile[Sync](), then removing the extension would break. But typescript also would break when invoking tsc.

It seems that relative paths are broken. Using a extends with an absolute path works.

@huafu I don't actually run tsc with the test/tsconfig.json, it's just for testing so it's the one that ts-jest sees. However, I do have a lint/tsconfig.json that TS Lint reads that has exactly the same extends property and accepts it fine. Maybe the way that ts-jest uses the readConfig API might be different to the way tsc and TS Lint do it? It's odd that TS would break backwards compatiblity like that. The manual even shows to not include the .json

thanks @mattyclarkson for the info on tslint, I'll look at the given reader there to see which one they use and will try to use

@mattyclarkson it is fixed in 23.1.2, just checked:
screen shot 2018-08-04 at 07 56 39

I had an issue today where I used "extends": "tsconfig.base.json" and got an error telling me it could not be found. The solution was to change it to "./tsconfig.base.json". Hopefully this helps someone.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stangerjm picture stangerjm  路  4Comments

bySabi picture bySabi  路  4Comments

ahnpnl picture ahnpnl  路  3Comments

remcohaszing picture remcohaszing  路  4Comments

qm3ster picture qm3ster  路  3Comments