Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
cspotcode committed Apr 26, 2020
1 parent 6a32006 commit 9bd86e8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,21 @@ describe('ts-node', function () {
cp.stdin!.end('true')
})

it('should run REPL when --interactive passed and stdin is not a TTY', function (done) {
const cp = exec(`${cmd} --interactive`, function (err, stdout) {
expect(err).to.equal(null)
expect(stdout).to.equal(
'> 123\n' +
'undefined\n' +
'> '
)
return done()
})

cp.stdin!.end('console.log("123")\n')

})

it('should support require flags', function (done) {
exec(`${cmd} -r ./tests/hello-world -pe "console.log('success')"`, function (err, stdout) {
expect(err).to.equal(null)
Expand Down

0 comments on commit 9bd86e8

Please sign in to comment.