Skip to content

Commit

Permalink
Issue #39: add a test to ensure that we can use the lazy configuratio…
Browse files Browse the repository at this point in the history
…n API with all tasks.

(cherry picked from commit 36ffe6b)
  • Loading branch information
bsautel committed Apr 29, 2020
1 parent ea3bb04 commit 9be9762
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class NpxTask_integTest
result1.task(":npmInstall").outcome == TaskOutcome.SUCCESS
result1.task(":lint").outcome == TaskOutcome.SUCCESS
result1.task(":test").outcome == TaskOutcome.SUCCESS
result1.output.contains("3 problems (0 errors, 3 warnings)")
result1.output.contains("5 problems (0 errors, 5 warnings)")
result1.output.contains("1 passing")

when:
Expand Down
6 changes: 6 additions & 0 deletions src/test/resources/fixtures/javascript-project/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@
"mocha": "6.2.0",
"chai": "4.2.0"
},
"devDependencies": {
"@babel/cli": "^7.0.0",
"@babel/core": "^7.0.0"
},
"scripts": {
"buildNpm": "babel src --out-dir build/npm-output",
"build": "babel src",
"test": "mocha"
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const hello = require('./');
const hello = require('../src');
const sayHello = hello.sayHello;
const chai = require('chai');
const expect = chai.expect;
Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/fixtures/npm/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ task test(type: NpmTask) {
dependsOn npmInstall
npmCommand = changeInputs ? ['run', 'test'] : ['run']
args = changeInputs ? [] : ['test']
inputs.dir('node_modules')
inputs.file('package.json')
inputs.files('index.js', 'test.js')
inputs.dir('src')
inputs.dir('test')
outputs.upToDateWhen {
true
}
Expand Down
12 changes: 7 additions & 5 deletions src/test/resources/fixtures/npx/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ node {
task lint(type: NpxTask) {
dependsOn npmInstall
command = "[email protected]"
args = ["index.js", "test.js"]
inputs.files(".eslintrc.yml", "index.js")
args = ["src", "test"]
inputs.file(".eslintrc.yml")
inputs.dir("src")
inputs.dir("test")
outputs.upToDateWhen {
true
}
Expand All @@ -23,9 +25,9 @@ task lint(type: NpxTask) {
task test(type: NpxTask) {
dependsOn lint
command = "mocha"
inputs.dir("node_modules")
inputs.file("package.json")
inputs.files("index.js", "test.js")
inputs.dir("src")
inputs.dir("test")
outputs.upToDateWhen {
true
}
Expand All @@ -51,7 +53,7 @@ task version(type: NpxTask) {
}

if (isPropertyEnabled("changeInputs")) {
lint.args = ["index.js"]
lint.args = ["src"]
test.command = "_mocha"
}

Expand Down
3 changes: 2 additions & 1 deletion src/test/resources/fixtures/yarn/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ task test(type: YarnTask) {
args = changeInputs ? [] : ["test"]
inputs.dir("node_modules")
inputs.file("package.json")
inputs.files("index.js", "test.js")
inputs.dir("src")
inputs.dir("test")
outputs.upToDateWhen {
true
}
Expand Down

0 comments on commit 9be9762

Please sign in to comment.