Skip to content
This repository was archived by the owner on Feb 1, 2022. It is now read-only.

Commit 4f4a60c

Browse files
authored
Fix tests (#118)
1. Fix test runner so that it actually runs all of the tests 2. Test the exact markup generated 3. Fix the Flow test to make it proper syntax and pass
1 parent b0a6aa2 commit 4f4a60c

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

Diff for: test/es6-flow-component.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function countTo(n:number):string {
1010
return a.join(', ');
1111
}
1212

13-
class Index = extends React.Component {
13+
class Index extends React.Component {
1414
render() {
1515
return (
1616
<div>

Diff for: test/index.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,13 @@ var viewOptions = {
1010

1111
function testComponent(path, cb) {
1212
var render = viewEngine.createEngine();
13-
render(__dirname + '/es5-component.jsx', viewOptions, function(err, source) {
14-
assert(!err);
15-
assert(source.indexOf('I can count to 10:1, 2, 3, 4, 5, 6, 7, 8, 9, 10') !== -1);
13+
render(path, viewOptions, function(err, source) {
14+
assert(!err, `Rendering ${path}: Did not throw`);
15+
assert.equal(
16+
source,
17+
'<!DOCTYPE html><div><h1></h1><p>Welcome to </p><p>I can count to 10:1, 2, 3, 4, 5, 6, 7, 8, 9, 10</p></div>',
18+
`Rendering ${path}: generated expected content`
19+
);
1620
cb();
1721
});
1822
}

0 commit comments

Comments
 (0)