Add simple tests for HMR usage

This commit is contained in:
ColCh 2014-09-29 19:19:20 +04:00
parent 18ff31dd61
commit 19a2eb963a

View File

@ -3,6 +3,7 @@
var path = require('path');
var helpers = require('yeoman-generator').test;
var assert = require('yeoman-generator').assert;
var _ = require('underscore.string');
describe('react-webpack generator', function() {
@ -93,6 +94,19 @@ describe('react-webpack generator', function() {
});
});
it('should use HMR webpack API inside of configs', function (done) {
react.run({}, function() {
assert.fileContent([
['package.json', /react-hot-loader/],
['Gruntfile.js', /hot:\s*true/],
['webpack.config.js', /react-hot/],
['webpack.config.js', /webpack\.HotModuleReplacementPlugin/],
['webpack.config.js', /webpack\/hot\/dev-server/]
]);
done();
});
});
});
describe('Subgenerators', function() {