Skip to content

Commit 89e42cc

Browse files
authored
add test for REPL .type command (#1115)
1 parent 66732d6 commit 89e42cc

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/index.spec.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,20 @@ describe('ts-node', function () {
355355
cp.stdin!.end('console.log("123")\n')
356356

357357
})
358+
it('REPL has command to get type information', function (done) {
359+
const cp = exec(`${cmd} --interactive`, function (err, stdout) {
360+
expect(err).to.equal(null)
361+
expect(stdout).to.equal(
362+
'> undefined\n' +
363+
'> undefined\n' +
364+
'> const a: 123\n' +
365+
'> '
366+
)
367+
return done()
368+
})
369+
370+
cp.stdin!.end('\nconst a = 123\n.type a')
371+
})
358372

359373
it('should support require flags', function (done) {
360374
exec(`${cmd} -r ./tests/hello-world -pe "console.log('success')"`, function (err, stdout) {

0 commit comments

Comments
 (0)