ts-jest transpilation possibly too permissive?

Created on 27 Jul 2018  Â·  5Comments  Â·  Source: kulshekhar/ts-jest

  • Issue

I'm noticing an issue where ts-jest seems to magically fix syntax errors that should PROBABLY be reported and fail a test.

The following test was run (see linked repo for more):

it('this should fail', () => {
    console.log({
        foo: 1
        bar: 2
        baz: 3
    })))))))}})})})123})))@}#)}
});
  • Expected behavior

The missing commas are detected as a syntax error, and the test fails.

  • Output from your debug log

I followed the instructions, but no debug log was generated.

  • Link to a minimal repo that reproduces this issue

https://github.com/timhwang21/tslint-bug-test

Most helpful comment

Great! Since the same issue is tracked elsewhere I'll close this if that's ok. Thanks for the extremely quick response!

All 5 comments

From the README of my linked repo, for convenience:

Expectation

An error is thrown due to the absurd syntax of App.test.ts

Actual

 PASS  src/App.test.ts
  ✓ this should fail (26ms)

  console.log src/App.test.ts:2
    { foo: 1, bar: 2, baz: 3 }

Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        2.103s

Bonus

Running tsc gives a ton of errors, as expected.

Duplicate of #507 ?

Yup @GeeWee – I wanted to add this, but my PR was already too big haha. That was the next thing I had in my mind if noone did or had time to handle it, once #626 get merged ;-)

update: must be an option tho, as it does run slower then.

You're a machine man.
( Feel free to base new PRs on your old PR though, we usually merge them in without too many changes, and it allows you to build on your work even when we're slowpokes)

Great! Since the same issue is tracked elsewhere I'll close this if that's ok. Thanks for the extremely quick response!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

qm3ster picture qm3ster  Â·  3Comments

stephenotalora picture stephenotalora  Â·  3Comments

AlexGellert picture AlexGellert  Â·  4Comments

mikeyakymenko picture mikeyakymenko  Â·  3Comments

RiJung picture RiJung  Â·  4Comments