Skip to content

Commit

Permalink
Added testem support
Browse files Browse the repository at this point in the history
Resolves gajus#1
  • Loading branch information
PlasmaPower committed May 10, 2016
1 parent a20a718 commit 2010457
Show file tree
Hide file tree
Showing 6 changed files with 48,926 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ node_js:
- 'iojs-v2.5.0'
install:
- npm install
script:
- npm run testem-ci
notifications:
email: false
37 changes: 37 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
var gulp = require('gulp');
var webpack = require('webpack-stream');

gulp.task('testem-js', function() {
return gulp.src('testem/src/index.js')
.pipe(webpack({
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel',
query: {
presets: ['es2015', 'stage-0'],
plugins: ['transform-react-jsx', 'transform-runtime']
}
}
]
},
node: {
fs: 'empty'
},
output: {
filename: 'tests.js'
}
}))
.pipe(gulp.dest('testem/build'));
});

gulp.task('build-testem', ['testem-js']);

gulp.task('watch-testem', ['build-testem'], function () {
gulp.watch('src/*.js', ['testem-js']);
gulp.watch('testem/src/*.js', ['testem-js']);
});

gulp.task('default', ['build-testem']);
16 changes: 14 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,22 @@
},
"devDependencies": {
"@kadira/storybook": "^1.2.0",
"babel-core": "^6.8.0",
"babel-loader": "^6.2.4",
"babel-plugin-transform-react-jsx": "^6.8.0",
"babel-plugin-transform-runtime": "^6.8.0",
"babel-preset-es2015": "^6.6.0",
"babel-preset-stage-0": "^6.5.0",
"chai": "^3.5.0",
"gulp": "^3.9.1",
"jsdom": "^8.3.0",
"pragmatist": "^3.0.21",
"qunit": "^0.9.1",
"react": "^0.14.8",
"react-addons-test-utils": "^0.14.8",
"react-dom": "^0.14.8"
"react-dom": "^0.14.8",
"testem": "^1.6.0",
"webpack-stream": "^3.2.0"
},
"scripts": {
"pragmatist": "pragmatist",
Expand All @@ -45,6 +55,8 @@
"build": "pragmatist --es5 build",
"watch-build": "pragmatist --es5 watch-build",
"preversion": "npm run lint && npm run test && npm run build",
"demo": "start-storybook -p 9001"
"demo": "start-storybook -p 9001",
"testem": "testem",
"testem-ci": "testem ci -l PhantomJS"
}
}
6 changes: 6 additions & 0 deletions testem.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"framework": "mocha",
"src_files": [
"testem/build/*.js"
]
}
Loading

0 comments on commit 2010457

Please sign in to comment.