Skip to content

Commit

Permalink
add failing test for #1004
Browse files Browse the repository at this point in the history
  • Loading branch information
cspotcode committed Apr 12, 2020
1 parent 2a0f1f3 commit 1aaa2e1
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,14 @@ describe('ts-node', function () {
expect(err).to.equal(null)
expect(stdout).to.equal('.ts\n')

return done()
})
})
it('should read tsconfig relative to realpath, not symlink, in scriptMode', function (done) {
exec(`node ${BIN_SCRIPT_PATH} tests/main-realpath/symlink/symlink.tsx`, function (err, stdout) {
expect(err).to.equal(null)
expect(stdout).to.equal('')

return done()
})
})
Expand Down
1 change: 1 addition & 0 deletions tests/main-realpath/symlink/symlink.tsx
1 change: 1 addition & 0 deletions tests/main-realpath/symlink/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
this tsconfig is intentionally invalid, to confirm that ts-node does *not* attempt to parse it
4 changes: 4 additions & 0 deletions tests/main-realpath/target/target.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Will throw a compiler error unless ./tsconfig.json is parsed, which enables JSX
function foo() {
<div></div>
}
5 changes: 5 additions & 0 deletions tests/main-realpath/target/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"compilerOptions": {
"jsx": "react"
}
}

0 comments on commit 1aaa2e1

Please sign in to comment.