From 2e3937047fd030bf46239086caca806dc67c8628 Mon Sep 17 00:00:00 2001 From: Andy Stanberry Date: Tue, 28 Sep 2021 19:11:52 -0400 Subject: [PATCH] failing swc transpiler repl test --- src/test/repl/repl.spec.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/test/repl/repl.spec.ts b/src/test/repl/repl.spec.ts index 6ec33f434..d3b03a83d 100644 --- a/src/test/repl/repl.spec.ts +++ b/src/test/repl/repl.spec.ts @@ -30,6 +30,16 @@ test('should run REPL when --interactive passed and stdin is not a TTY', async ( expect(stdout).toBe('> 123\n' + 'undefined\n' + '> '); }); +test('should echo a value when using the swc transpiler', async () => { + const execPromise = exec( + `${CMD_TS_NODE_WITH_PROJECT_FLAG} --interactive --transpiler ts-node/transpilers/swc-experimental` + ); + execPromise.child.stdin!.end('400\n401\n'); + const { err, stdout } = await execPromise; + expect(err).toBe(null); + expect(stdout).toBe('> 400\n>401\n > '); +}); + test('REPL has command to get type information', async () => { const execPromise = exec(`${CMD_TS_NODE_WITH_PROJECT_FLAG} --interactive`); execPromise.child.stdin!.end('\nconst a = 123\n.type a');