@@ -10,6 +10,8 @@ const testDir = join(__dirname, '../tests')
1010const EXEC_PATH = join ( __dirname , '../dist/bin' )
1111const BIN_EXEC = `node "${ EXEC_PATH } " --project "${ testDir } "`
1212
13+ const SOURCE_MAP_REGEXP = / \/ \/ # s o u r c e M a p p i n g U R L = d a t a : a p p l i c a t i o n \/ j s o n ; c h a r s e t = u t f \- 8 ; b a s e 6 4 , [ \w \+ ] + = * $ /
14+
1315describe ( 'ts-node' , function ( ) {
1416 this . timeout ( 10000 )
1517
@@ -177,7 +179,7 @@ describe('ts-node', function () {
177179 } )
178180
179181 it ( 'should pipe into an eval script' , function ( done ) {
180- const cp = exec ( `${ BIN_EXEC } -p 'declare var process: any\nprocess .stdin.isTTY'` , function ( err , stdout ) {
182+ const cp = exec ( `${ BIN_EXEC } --fast - p 'process.stdin.isTTY'` , function ( err , stdout ) {
181183 expect ( err ) . to . equal ( null )
182184 expect ( stdout ) . to . equal ( 'undefined\n' )
183185
@@ -204,6 +206,15 @@ describe('ts-node', function () {
204206 return done ( )
205207 } )
206208 } )
209+
210+ it . skip ( 'should use source maps with react tsx' , function ( done ) {
211+ exec ( `${ BIN_EXEC } -r ./tests/emit-compiled.ts tests/jsx-react.tsx` , function ( err , stdout ) {
212+ expect ( err ) . to . equal ( null )
213+ expect ( stdout ) . to . equal ( 'todo' )
214+
215+ return done ( )
216+ } )
217+ } )
207218 } )
208219
209220 describe ( 'register' , function ( ) {
@@ -259,6 +270,7 @@ describe('ts-node', function () {
259270 compiled = code
260271 return _compile . call ( this , code , fileName )
261272 }
273+
262274 return old ( m , fileName )
263275 }
264276 } )
@@ -272,8 +284,11 @@ describe('ts-node', function () {
272284 require ( '../tests/with-jsx.tsx' )
273285 } catch ( error ) {
274286 expect ( error . stack ) . to . contain ( 'SyntaxError: Unexpected token <\n' )
275- done ( )
276287 }
288+
289+ expect ( compiled ) . to . match ( SOURCE_MAP_REGEXP )
290+
291+ done ( )
277292 } )
278293 } )
279294 } )
0 commit comments