Skip to content

Commit

Permalink
add test for REPL .type command (#1115)
Browse files Browse the repository at this point in the history
  • Loading branch information
cspotcode authored Aug 13, 2020
1 parent 66732d6 commit 89e42cc
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 89e42cc

Please sign in to comment.