From c2fd8fc6ca49d71a774c9b3f264995d48ff081d9 Mon Sep 17 00:00:00 2001 From: Andrew Bradley Date: Wed, 12 Aug 2020 23:19:25 -0400 Subject: [PATCH] add test for REPL .type command --- src/index.spec.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/index.spec.ts b/src/index.spec.ts index 7a175c9c1..0c78dcd98 100644 --- a/src/index.spec.ts +++ b/src/index.spec.ts @@ -355,6 +355,20 @@ describe('ts-node', function () { cp.stdin!.end('console.log("123")\n') }) + it('REPL has command to get type information', function (done) { + const cp = exec(`${cmd} --interactive`, function (err, stdout) { + expect(err).to.equal(null) + expect(stdout).to.equal( + '> undefined\n' + + '> undefined\n' + + '> const a: 123\n' + + '> ' + ) + return done() + }) + + cp.stdin!.end('\nconst a = 123\n.type a') + }) it('should support require flags', function (done) { exec(`${cmd} -r ./tests/hello-world -pe "console.log('success')"`, function (err, stdout) {