Skip to content

Commit

Permalink
Configuring testJs gradle task with inputs and outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
craigatk committed Oct 1, 2016
1 parent 4c70174 commit 29291f8
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 116 deletions.
8 changes: 6 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ node {
nodeModulesDir = file("${project.projectDir}/src/app")
}

task jsTest(type: NpmTask, dependsOn: 'npmInstall') {
task testJs(type: NpmTask, dependsOn: 'npmInstall') {
inputs.dir('src/app/test/unit')
outputs.dir('src/app/test/reports')
args = ['run', 'test']
}
}

check.dependsOn('testJs')
1 change: 1 addition & 0 deletions src/app/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ npm-debug.log
selenium-debug.log
test/unit/coverage
test/e2e/reports
test/reports

# IDEA project files
.idea/
Expand Down
1 change: 1 addition & 0 deletions src/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"json-loader": "0.5.4",
"karma": "0.13.19",
"karma-jasmine": "1.0.2",
"karma-junit-reporter": "^1.1.0",
"karma-phantomjs-launcher": "1.0.0",
"karma-sinon-chai": "1.2.0",
"karma-sourcemap-loader": "0.3.7",
Expand Down
26 changes: 0 additions & 26 deletions src/app/test/e2e/custom-assertions/elementCount.js

This file was deleted.

42 changes: 0 additions & 42 deletions src/app/test/e2e/nightwatch.conf.js

This file was deleted.

31 changes: 0 additions & 31 deletions src/app/test/e2e/runner.js

This file was deleted.

14 changes: 0 additions & 14 deletions src/app/test/e2e/specs/test.js

This file was deleted.

6 changes: 5 additions & 1 deletion src/app/test/unit/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ module.exports = function (config) {
// 2. add it to the `browsers` array below.
browsers: ['PhantomJS'],
frameworks: ['jasmine'],
reporters: ['spec'],
reporters: ['spec', 'junit'],
files: [
'../../node_modules/babel-polyfill/dist/polyfill.js',
'./index.js'
Expand All @@ -66,6 +66,10 @@ module.exports = function (config) {
webpack: webpackConfig,
webpackMiddleware: {
noInfo: true
},
junitReporter: {
outputDir: '../reports', // results will be saved as $outputDir/$browserName.xml
outputFile: undefined, // if included, results will be saved as $outputDir/$browserName/$outputFile
}
})
}

0 comments on commit 29291f8

Please sign in to comment.