mirror of
https://github.com/wassname/generator-react-webpack.git
synced 2026-10-29 13:11:10 +08:00
Project test configuration and updated README
Signed-off-by: Simon Bailey <simon@newtriks.com>
This commit is contained in:
1 parent
b1562cd74c
commit
fb2e98d63e
8 files changed
+268
-34
No files matched your search
@@ -116,7 +116,7 @@ module.exports = function (grunt) {
|
||||
}
|
||||
});
|
||||
|
||||
grunt.registerTask('server', function (target) {
|
||||
grunt.registerTask('serve', function (target) {
|
||||
if (target === 'dist') {
|
||||
return grunt.task.run(['build', 'open', 'connect:dist:keepalive']);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function (config) {
|
||||
config.set({
|
||||
basePath: '',
|
||||
frameworks: ['jasmine'],
|
||||
files: [
|
||||
'test/helpers/**/*.js',
|
||||
'test/spec/components/**/*.js'
|
||||
],
|
||||
preprocessors: {
|
||||
'test/spec/components/**/*.js': ['webpack']
|
||||
},
|
||||
webpack: {
|
||||
cache: true,
|
||||
module: {
|
||||
loaders: [{
|
||||
test: /\.css$/,
|
||||
loader: 'style!css'
|
||||
}, {
|
||||
test: /\.gif/,
|
||||
loader: 'url-loader?limit=10000&minetype=image/gif'
|
||||
}, {
|
||||
test: /\.jpg/,
|
||||
loader: 'url-loader?limit=10000&minetype=image/jpg'
|
||||
}, {
|
||||
test: /\.png/,
|
||||
loader: 'url-loader?limit=10000&minetype=image/png'
|
||||
}, {
|
||||
test: /\.js$/,
|
||||
loader: 'jsx-loader'
|
||||
}]
|
||||
}
|
||||
},
|
||||
webpackServer: {
|
||||
stats: {
|
||||
colors: true
|
||||
}
|
||||
},
|
||||
exclude: [],
|
||||
port: 8080,
|
||||
logLevel: config.LOG_INFO,
|
||||
colors: true,
|
||||
autoWatch: false,
|
||||
// Start these browsers, currently available:
|
||||
// - Chrome
|
||||
// - ChromeCanary
|
||||
// - Firefox
|
||||
// - Opera
|
||||
// - Safari (only Mac)
|
||||
// - PhantomJS
|
||||
// - IE (only Windows)
|
||||
browsers: ['PhantomJS'],
|
||||
reporters: ['progress'],
|
||||
captureTimeout: 60000,
|
||||
singleRun: true
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* @jsx React.DOM
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var React = require('react/addons');
|
||||
|
||||
var <%= classedName %> = React.createClass({
|
||||
/*jshint ignore:start */
|
||||
render: function () {
|
||||
return (
|
||||
<div>
|
||||
<p>Content for <%= classedName %></p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
/*jshint ignore:end */
|
||||
});
|
||||
|
||||
module.exports = <%= classedName %>;
|
||||
@@ -0,0 +1,14 @@
|
||||
'use strict';
|
||||
|
||||
describe('<%= classedName %>', function () {
|
||||
var <%= classedName %>, component;
|
||||
|
||||
beforeEach(function () {
|
||||
<%= classedName %> = require('../../../src/scripts/components/<%= classedName %>');
|
||||
component = <%= classedName %>();
|
||||
});
|
||||
|
||||
it('should create a new instance of <%= classedName %>', function () {
|
||||
expect(component).toBeDefined();
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user