diff --git a/src/index.spec.ts b/src/index.spec.ts index 0d41f65d2..064f42ee0 100644 --- a/src/index.spec.ts +++ b/src/index.spec.ts @@ -189,7 +189,7 @@ describe('ts-node', function () { } expect(err.message).to.contain([ - `${join(__dirname, '../tests/throw.ts')}:3`, + `${join(__dirname, '../tests/throw.ts')}:100`, ' bar () { throw new Error(\'this is a demo\') }', ' ^', 'Error: this is a demo' @@ -206,7 +206,7 @@ describe('ts-node', function () { } expect(err.message).to.contain([ - `${join(__dirname, '../tests/throw.ts')}:3`, + `${join(__dirname, '../tests/throw.ts')}:100`, ' bar () { throw new Error(\'this is a demo\') }', ' ^' ].join('\n')) @@ -611,7 +611,7 @@ describe('ts-node', function () { } catch (error) { expect(error.stack).to.contain([ 'Error: this is a demo', - ` at Foo.bar (${join(__dirname, '../tests/throw.ts')}:3:18)` + ` at Foo.bar (${join(__dirname, '../tests/throw.ts')}:100:18)` ].join('\n')) done() diff --git a/tests/throw.ts b/tests/throw.ts index 1183d9ff5..dbd4cbc2e 100644 --- a/tests/throw.ts +++ b/tests/throw.ts @@ -1,4 +1,101 @@ +// intentional whitespace to prove that sourcemaps are working. Throw should happen on line 100. +// 100 lines is meant to be far more space than the helper functions would take. class Foo { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + constructor () { this.bar() } bar () { throw new Error('this is a demo') } }