Skip to content

Commit

Permalink
Merge pull request #876 from SoprisApps/patch-fix-cli-ava-tests
Browse files Browse the repository at this point in the history
Fix react-server-cli AVA test issues
  • Loading branch information
drewpc authored Feb 10, 2017
2 parents 3eeb22b + 21f743e commit 9611f41
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
10 changes: 8 additions & 2 deletions packages/react-server-cli/test/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,14 @@ fs.readdirSync(fixturesPath).forEach(testName => {
}, frequency);
});

if (stdoutIncludes) t.true(stdout.includes(stdoutIncludes), 'stdout includes expected output');
if (stderrIncludes) t.true(stderr.includes(stderrIncludes), 'stderr includes expected output');
t.true(
stderrIncludes ? stderr.includes(stderrIncludes) : stderr === '',
'stderr does not include expected output. Instead, it says: ' + stderr
);
t.true(
stdoutIncludes ? stdout.includes(stdoutIncludes) : stdout === '',
'stdout does not include expected output. Instead, it says: ' + stdout
);

server.kill();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"args": ["start"],
"args": ["start", "--port", "8780", "--js-port", "8781"],
"stdoutIncludes": "Started HTML server over HTTP on"
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"args": ["start"],
"args": ["start", "--port", "8782", "--js-port", "8783"],
"stderrIncludes": "Failed to load routes file at"
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"args": ["start"],
"args": ["start", "--port", "8784", "--js-port", "8785"],
"stdoutIncludes": "Started HTML server over HTTP on"
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"args": ["start", "--routes-file", "routes.js"],
"args": ["start", "--routes-file", "routes.js", "--port", "8786", "--js-port", "8787"],
"stderrIncludes": "ReferenceError: undeclaredVariable is not defined"
}

0 comments on commit 9611f41

Please sign in to comment.