Skip to content

Commit

Permalink
Chore: rename tests: env-check/overwriting → package-config
Browse files Browse the repository at this point in the history
  • Loading branch information
mysticatea committed Aug 31, 2016
1 parent f873b35 commit a32ca2f
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 22 deletions.
6 changes: 3 additions & 3 deletions test-workspace/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"scripts": {
"start": "node tasks/append2.js start",
"stop": "node tasks/append2.js stop",
"test-task:env-check": "node tasks/env-check.js",
"test-task:env-check2": "node tasks/env-check2.js",
"test-task:nested-env-check": "babel-node ../src/bin/npm-run-all/index.js test-task:env-check",
"test-task:package-config": "node tasks/package-config1.js",
"test-task:package-config2": "node tasks/package-config2.js",
"test-task:nested-package-config": "babel-node ../src/bin/npm-run-all/index.js test-task:package-config",
"test-task:append": "node tasks/append2.js",
"test-task:append:a": "node tasks/append2.js a",
"test-task:append:a:c": "node tasks/append2.js ac",
Expand Down
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions test/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,22 +133,22 @@ describe("[common]", () => {

describe("should run a task by npm (check an environment variable):", () => {
it("Node API", () =>
nodeApi("test-task:env-check")
nodeApi("test-task:package-config")
.then(() => assert(result() === "OK"))
)

it("npm-run-all command", () =>
runAll(["test-task:env-check"])
runAll(["test-task:package-config"])
.then(() => assert(result() === "OK"))
)

it("run-s command", () =>
runSeq(["test-task:env-check"])
runSeq(["test-task:package-config"])
.then(() => assert(result() === "OK"))
)

it("run-p command", () =>
runPar(["test-task:env-check"])
runPar(["test-task:package-config"])
.then(() => assert(result() === "OK"))
)
})
Expand Down
30 changes: 15 additions & 15 deletions test/overwriting.js → test/package-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,43 +22,43 @@ const runPar = require("../src/bin/run-p")
// Test
//------------------------------------------------------------------------------

describe("[overwriting] it should have an ability to overwrite package's config:", () => {
describe("[package-config] it should have an ability to overwrite package's config:", () => {
before(() => process.chdir("test-workspace"))
after(() => process.chdir(".."))

beforeEach(removeResult)

it("Node API should address \"packageConfig\" option", () =>
nodeApi("test-task:env-check", {packageConfig: {"npm-run-all-test": {test: "OVERWRITTEN"}}})
nodeApi("test-task:package-config", {packageConfig: {"npm-run-all-test": {test: "OVERWRITTEN"}}})
.then(() => {
assert(result() === "OVERWRITTEN")
})
)

it("Node API should address \"packageConfig\" option for multiple variables", () =>
nodeApi("test-task:env-check2", {packageConfig: {"npm-run-all-test": {test: "1", test2: "2", test3: "3"}}})
nodeApi("test-task:package-config2", {packageConfig: {"npm-run-all-test": {test: "1", test2: "2", test3: "3"}}})
.then(() => {
assert(result() === "1\n2\n3")
})
)

describe("CLI commands should address \"--a:b=c\" style options", () => {
it("npm-run-all command", () =>
runAll(["test-task:env-check", "--npm-run-all-test:test=OVERWRITTEN"])
runAll(["test-task:package-config", "--npm-run-all-test:test=OVERWRITTEN"])
.then(() => {
assert(result() === "OVERWRITTEN")
})
)

it("run-s command", () =>
runSeq(["test-task:env-check", "--npm-run-all-test:test=OVERWRITTEN"])
runSeq(["test-task:package-config", "--npm-run-all-test:test=OVERWRITTEN"])
.then(() => {
assert(result() === "OVERWRITTEN")
})
)

it("run-p command", () =>
runPar(["test-task:env-check", "--npm-run-all-test:test=OVERWRITTEN"])
runPar(["test-task:package-config", "--npm-run-all-test:test=OVERWRITTEN"])
.then(() => {
assert(result() === "OVERWRITTEN")
})
Expand All @@ -67,21 +67,21 @@ describe("[overwriting] it should have an ability to overwrite package's config:

describe("CLI commands should address \"--a:b=c\" style options for multiple variables", () => {
it("npm-run-all command", () =>
runAll(["test-task:env-check2", "--npm-run-all-test:test=1", "--npm-run-all-test:test2=2", "--npm-run-all-test:test3=3"])
runAll(["test-task:package-config2", "--npm-run-all-test:test=1", "--npm-run-all-test:test2=2", "--npm-run-all-test:test3=3"])
.then(() => {
assert(result() === "1\n2\n3")
})
)

it("run-s command", () =>
runSeq(["test-task:env-check2", "--npm-run-all-test:test=1", "--npm-run-all-test:test2=2", "--npm-run-all-test:test3=3"])
runSeq(["test-task:package-config2", "--npm-run-all-test:test=1", "--npm-run-all-test:test2=2", "--npm-run-all-test:test3=3"])
.then(() => {
assert(result() === "1\n2\n3")
})
)

it("run-p command", () =>
runPar(["test-task:env-check2", "--npm-run-all-test:test=1", "--npm-run-all-test:test2=2", "--npm-run-all-test:test3=3"])
runPar(["test-task:package-config2", "--npm-run-all-test:test=1", "--npm-run-all-test:test2=2", "--npm-run-all-test:test3=3"])
.then(() => {
assert(result() === "1\n2\n3")
})
Expand All @@ -90,21 +90,21 @@ describe("[overwriting] it should have an ability to overwrite package's config:

describe("CLI commands should address \"--a:b c\" style options", () => {
it("npm-run-all command", () =>
runAll(["test-task:env-check", "--npm-run-all-test:test", "OVERWRITTEN"])
runAll(["test-task:package-config", "--npm-run-all-test:test", "OVERWRITTEN"])
.then(() => {
assert(result() === "OVERWRITTEN")
})
)

it("run-s command", () =>
runSeq(["test-task:env-check", "--npm-run-all-test:test", "OVERWRITTEN"])
runSeq(["test-task:package-config", "--npm-run-all-test:test", "OVERWRITTEN"])
.then(() => {
assert(result() === "OVERWRITTEN")
})
)

it("run-p command", () =>
runPar(["test-task:env-check", "--npm-run-all-test:test", "OVERWRITTEN"])
runPar(["test-task:package-config", "--npm-run-all-test:test", "OVERWRITTEN"])
.then(() => {
assert(result() === "OVERWRITTEN")
})
Expand All @@ -113,21 +113,21 @@ describe("[overwriting] it should have an ability to overwrite package's config:

describe("CLI commands should transfar overriting nested commands.", () => {
it("npm-run-all command", () =>
runAll(["test-task:nested-env-check", "--npm-run-all-test:test", "OVERWRITTEN"])
runAll(["test-task:nested-package-config", "--npm-run-all-test:test", "OVERWRITTEN"])
.then(() => {
assert(result() === "OVERWRITTEN")
})
)

it("run-s command", () =>
runSeq(["test-task:nested-env-check", "--npm-run-all-test:test", "OVERWRITTEN"])
runSeq(["test-task:nested-package-config", "--npm-run-all-test:test", "OVERWRITTEN"])
.then(() => {
assert(result() === "OVERWRITTEN")
})
)

it("run-p command", () =>
runPar(["test-task:nested-env-check", "--npm-run-all-test:test", "OVERWRITTEN"])
runPar(["test-task:nested-package-config", "--npm-run-all-test:test", "OVERWRITTEN"])
.then(() => {
assert(result() === "OVERWRITTEN")
})
Expand Down

0 comments on commit a32ca2f

Please sign in to comment.