This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var grep = require('karma-webpack-grep') | |
var webpackConfig = require('./webpack.config') | |
module.exports = function (config) { | |
webpackConfig.plugins = (webpackConfig.plugins || []).concat(grep({ | |
grep: config.grep, | |
basePath: '.', | |
testContext: './tests' | |
})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# build and run all tests | |
$ karma start | |
# build and run only those tests that are in this dir | |
$ karma start --grep app/modules/sidebar/tests | |
# build and run only this test file | |
$ karma start --grep app/modules/sidebar/tests/animation_test.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function (config) { | |
// karma parses cmd line args, therefore | |
// when executing `karma start --grep some/path` | |
// config will have `grep` set to 'some/path' | |
if (config.grep) { | |
var pattern = config.grep | |
// we then remove the .js suffix, this is useful | |
// because if you're typing `karma start --grep some/test_fi` and tab | |
// the terminal autocompletes to `karma start --grep some/test_file.js` | |
// however, we want to remove this to effectively make use of the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var webpack = require('webpack') | |
var webpackConfig = require('./webpack.config') | |
module.exports = function (config) { | |
// prep your webpack config for karma | |
delete webpackConfig.entry | |
webpackConfig.devtool = 'cheap-inline-source-map' | |
// karma --grep | |
if (config.grep) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var webpackConfig = require('./webpack.config') | |
module.exports = function (config) { | |
// prep your webpack config for karma | |
delete webpackConfig.entry | |
webpackConfig.devtool = 'cheap-inline-source-map' | |
config.set({ | |
// standard karma things | |
basePath: '.', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add this to your ~/.bash_profile or similar | |
# say you're on a branch `my-feature` and | |
# you merge the PR for that branch on GitHub | |
# you can now execute `gu` to run the following | |
gu () { | |
branch=$(git symbolic-ref --short HEAD) | |
git checkout master | |
git pull |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
router.use(loadingAnimation) | |
router.use(loadHandlers(router)) | |
router.use(computeAlreadyActive) | |
router.use(modelHook) | |
router.use(activateHook) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* To run this example locally: | |
* | |
* $ git clone https://github.com/QubitProducts/cherrytree.git | |
* $ cd cherrytree/examples/hello-world-react | |
* $ npm install | |
* $ npm start | |
* $ open http://localhost:8000 | |
* | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A generic render helper for cherrytree + react + express. | |
* | |
* To run this example locally: | |
* | |
* $ git clone https://github.com/QubitProducts/cherrytree.git | |
* $ cd cherrytree/examples/server-side-react | |
* $ npm install | |
* $ npm start | |
* $ open http://localhost:8000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// require() some stuff from npm (like you were using browserify) | |
// and then hit Run Code to run it on the right | |
var sinon = require("sinon") | |
console.log(sinon) | |
window.sinon = sinon | |
/* | |
sinon.stub(window.history, "pushState", function () { | |
console.log("PUSHING") | |
}) |