Skip to content

Commit 488a840

Browse files
committed
Split out Webpacker dummy and sprockets dummy, then change to that dir to run tests
1 parent ed8a891 commit 488a840

29 files changed

+467
-154
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// This is a manifest file that'll be compiled into application.js, which will include all the files
2+
// listed below.
3+
//
4+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5+
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6+
//
7+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8+
// compiled file.
9+
//
10+
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11+
// about supported directives.
12+
//
13+
//
14+
// es5-shim is necessary for PhantomJS to pass tests. See https://github.com/facebook/react/issues/303
15+
//
16+
//= require turbolinks
17+
//= require es5-shim/es5-shim
18+
//= require react
19+
//= require react_ujs
20+
//= require_tree ./components
21+
//= require ./pages
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
//= require_self
2+
//= require_tree ./components
3+
//= require ./pages
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
var Todo = React.createClass({
2+
render: function() {
3+
return React.createElement("li", null, this.props.todo)
4+
}
5+
})
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Todo = React.createClass
2+
render: ->
3+
`<li>{this.props.todo}</li>`
4+
5+
# Because Coffee files are in an anonymous function,
6+
# expose it for server rendering tests
7+
this.Todo = Todo
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
TodoList = React.createClass({
2+
getInitialState: function() {
3+
return({mounted: "nope"});
4+
},
5+
componentWillMount: function() {
6+
this.setState({mounted: 'yep'});
7+
},
8+
render: function() {
9+
console.log("Test Console Replay")
10+
return (
11+
<ul>
12+
<li id='status'>{this.state.mounted}</li>
13+
{this.props.todos.map(function(todo, i) {
14+
return (<Todo key={i} todo={todo} />)
15+
})}
16+
</ul>
17+
)
18+
}
19+
})
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
TodoListWithConsoleLog = React.createClass({
2+
getInitialState: function() {
3+
console.log('got initial state');
4+
return({mounted: "nope"});
5+
},
6+
componentWillMount: function() {
7+
console.warn('mounted component');
8+
this.setState({mounted: 'yep'});
9+
},
10+
render: function() {
11+
var x = 'foo';
12+
console.error('rendered!', x);
13+
return (
14+
<ul>
15+
<li>Console Logged</li>
16+
<li id='status'>{this.state.mounted}</li>
17+
{this.props.todos.map(function(todo, i) {
18+
return (<Todo key={i} todo={todo} />)
19+
})}
20+
</ul>
21+
)
22+
}
23+
})
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
WithSetTimeout = React.createClass({
2+
componentWillMount: function () {
3+
setTimeout(function () {}, 1000)
4+
clearTimeout(0)
5+
},
6+
render: function () {
7+
return <span>I am rendered!</span>
8+
}
9+
})
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[2, ...[1]];
2+
<div/>;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Component = React.createClass
2+
render: ->
3+
`<ExampleComponent videos={this.props.videos} />`
4+
5+
this.Component = Component
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<div/>;

0 commit comments

Comments
 (0)