Skip to content

Commit

Permalink
need the newline
Browse files Browse the repository at this point in the history
  • Loading branch information
robertDurst authored and blerner committed Aug 3, 2023
1 parent c7d12c4 commit f1103c9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/io-tests/io.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const parse_file_for_expected_std = (f) => {

// stdin
if (line.startsWith("###<")) {
stdInToInject = line.slice(line.indexOf(" ")).trim();
stdInToInject = line.slice(line.indexOf(" ")).trim() + "\n";
}

// stdout
Expand Down Expand Up @@ -75,10 +75,10 @@ describe("IO Tests", () => {
expect(compileProcess.status).toEqual(SUCCESS_EXIT_CODE);
expect(compileProcess.stderr.toString()).toEqual(EMPTY_MESSAGE);

const runProcess = cp.spawnSync("sh", [
"-c",
`echo ${stdInToInject} | node ${COMPILED_CODE_PATH}`
], {stdio: 'pipe', stderr: "pipe", timeout: RUN_TIMEOUT});
const runProcess = cp.spawnSync(
'node',
[COMPILED_CODE_PATH],
{input: stdInToInject, stdio: 'pipe', stderr: "pipe", timeout: RUN_TIMEOUT});

if (stderrExpected !== EMPTY_MESSAGE) {
expect(runProcess.status).not.toEqual(SUCCESS_EXIT_CODE);
Expand Down

0 comments on commit f1103c9

Please sign in to comment.