--- /dev/null
+/**
+ * Copyright 2015-present Greg Hurrell. All rights reserved.
+ * Licensed under the terms of the MIT license.
+ */
+
+require('babel/polyfill');
+
+var fs = require('fs');
+var path = require('path');
+
+process.on('unhandledRejection', function(reason, promise) {
+ throw reason;
+});
+
+global.expect = require('expect');
+
+require('babel/register')(
+ JSON.parse(
+ fs.readFileSync(
+ path.join(__dirname, '..', '.babelrc')
+ )
+ )
+);
--- /dev/null
+--require mocha/bootstrap
+--recursive
+--reporter list
--- /dev/null
+/**
+ * Copyright 2015-present Greg Hurrell. All rights reserved.
+ * Licensed under the terms of the MIT license.
+ */
+
+var Base = require('mocha').reporters.Base;
+
+/**
+ * Like the "min" reporter that comes with Mocha[0], but doesn't clear the
+ * screen.
+ *
+ * @see https://github.com/mochajs/mocha/blob/master/lib/reporters/min.js
+ * @see https://github.com/mochajs/mocha/wiki/Third-party-reporters
+ */
+function WatchReporter(runner) {
+ var self = this;
+ Base.call(this, runner);
+ runner.on('end', function() {
+ if (this.stats.failures) {
+ Base.prototype.epilogue.call(self);
+ }
+ });
+}
+
+module.exports = WatchReporter;
"version": "1.0.0",
"description": "Boilerplate for ReactJS project with hot code reloading",
"scripts": {
+ "lint": "eslint src",
"start": "node server.js",
- "lint": "eslint src"
+ "test": "mocha --opts mocha/mocha.opts 'src/**/__mocks__/*.js' 'src/**/__tests__/*-test.js'"
},
"repository": {
"type": "git",
},
"homepage": "https://github.com/gaearon/react-hot-boilerplate",
"devDependencies": {
+ "babel": "^5.8.19",
"babel-core": "^5.4.7",
"babel-eslint": "^3.1.9",
"babel-loader": "^5.1.2",
"eslint-plugin-react": "^2.3.0",
+ "expect": "^1.8.0",
+ "mocha": "^2.2.5",
"react-hot-loader": "^1.2.7",
+ "sinon": "^1.15.4",
"webpack": "^1.9.6",
"webpack-dev-server": "^1.8.2"
},
--- /dev/null
+// TODO: replace with actual mock files
--- /dev/null
+// TODO: replace with actual test files