Skip to content

Commit 1b8e1c8

Browse files
authored
Merge pull request #85 from bcomnes/disable-npm-config-overrides
Move support to node 16 and npm 8
2 parents 9a64a46 + 7d19dd4 commit 1b8e1c8

File tree

4 files changed

+77
-69
lines changed

4 files changed

+77
-69
lines changed

.github/workflows/release.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
required: true
99

1010
env:
11-
NODE_VERSION: 14
11+
NODE_VERSION: 'lts/*'
1212
FORCE_COLOR: 2
1313

1414
jobs:
@@ -29,7 +29,7 @@ jobs:
2929
- run: git status # getting odd dirty repo errors during version debug info
3030
- run: git diff
3131
- name: npm version && npm publish
32-
uses: bcomnes/npm-bump@v2
32+
uses: bcomnes/npm-bump@v2.0.2
3333
with:
3434
git_email: [email protected]
3535
git_username: ${{ github.actor }}

.github/workflows/test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
os: [ubuntu-latest, windows-latest]
16-
node: [14, 12]
15+
os: [ubuntu-latest, windows-latest, macos-latest]
16+
node: ['lts/*', 18]
1717

1818
steps:
1919
- uses: actions/checkout@v3

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"docs"
1515
],
1616
"engines": {
17-
"node": ">= 10"
17+
"node": ">= 16",
18+
"npm": ">= 8"
1819
},
1920
"scripts": {
2021
"_mocha": "mocha --timeout 120000",

test/package-config.js

+71-64
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// Requirements
1010
//------------------------------------------------------------------------------
1111

12+
const { execSync } = require("child_process")
1213
const assert = require("assert").strict
1314
const nodeApi = require("../lib")
1415
const util = require("./lib/util")
@@ -28,81 +29,87 @@ describe("[package-config] it should have an ability to overwrite package's conf
2829

2930
beforeEach(removeResult)
3031

31-
it("Node API should address \"packageConfig\" option", async () => {
32-
await nodeApi("test-task:package-config", { packageConfig: { "npm-run-all-test": { test: "OVERWRITTEN" } } })
33-
assert(result() === "OVERWRITTEN")
34-
})
32+
const [major] = execSync("npm --version", { encoding: "utf8" }).trim().split(".")
3533

36-
it("Node API should address \"packageConfig\" option for multiple variables", async () => {
37-
await nodeApi("test-task:package-config2", { packageConfig: { "npm-run-all-test": { test: "1", test2: "2", test3: "3" } } })
38-
assert(result() === "1\n2\n3")
39-
})
34+
const supportsOverrides = major <= 6
4035

41-
describe("CLI commands should address \"--a:b=c\" style options", () => {
42-
it("npm-run-all command", async () => {
43-
await runAll(["test-task:package-config", "--npm-run-all-test:test=OVERWRITTEN"])
44-
assert(result() === "OVERWRITTEN")
36+
if (supportsOverrides) {
37+
it("Node API should address \"packageConfig\" option", async () => {
38+
await nodeApi("test-task:package-config", { packageConfig: { "npm-run-all-test": { test: "OVERWRITTEN" } } })
39+
assert.equal(result(), "OVERWRITTEN")
4540
})
4641

47-
it("run-s command", async () => {
48-
await runSeq(["test-task:package-config", "--npm-run-all-test:test=OVERWRITTEN"])
49-
assert(result() === "OVERWRITTEN")
42+
it("Node API should address \"packageConfig\" option for multiple variables", async () => {
43+
await nodeApi("test-task:package-config2", { packageConfig: { "npm-run-all-test": { test: "1", test2: "2", test3: "3" } } })
44+
assert.equal(result(), "1\n2\n3")
5045
})
5146

52-
it("run-p command", async () => {
53-
await runPar(["test-task:package-config", "--npm-run-all-test:test=OVERWRITTEN"])
54-
assert(result() === "OVERWRITTEN")
47+
describe("CLI commands should address \"--a:b=c\" style options", () => {
48+
it("npm-run-all command", async () => {
49+
await runAll(["test-task:package-config", "--npm-run-all-test:test=OVERWRITTEN"])
50+
assert.equal(result(), "OVERWRITTEN")
51+
})
52+
53+
it("run-s command", async () => {
54+
await runSeq(["test-task:package-config", "--npm-run-all-test:test=OVERWRITTEN"])
55+
assert.equal(result(), "OVERWRITTEN")
56+
})
57+
58+
it("run-p command", async () => {
59+
await runPar(["test-task:package-config", "--npm-run-all-test:test=OVERWRITTEN"])
60+
assert.equal(result(), "OVERWRITTEN")
61+
})
5562
})
56-
})
5763

58-
describe("CLI commands should address \"--a:b=c\" style options for multiple variables", () => {
59-
it("npm-run-all command", async () => {
60-
await runAll(["test-task:package-config2", "--npm-run-all-test:test=1", "--npm-run-all-test:test2=2", "--npm-run-all-test:test3=3"])
61-
assert(result() === "1\n2\n3")
64+
describe("CLI commands should address \"--a:b=c\" style options for multiple variables", () => {
65+
it("npm-run-all command", async () => {
66+
await runAll(["test-task:package-config2", "--npm-run-all-test:test=1", "--npm-run-all-test:test2=2", "--npm-run-all-test:test3=3"])
67+
assert.equal(result(), "1\n2\n3")
68+
})
69+
70+
it("run-s command", async () => {
71+
await runSeq(["test-task:package-config2", "--npm-run-all-test:test=1", "--npm-run-all-test:test2=2", "--npm-run-all-test:test3=3"])
72+
assert.equal(result(), "1\n2\n3")
73+
})
74+
75+
it("run-p command", async () => {
76+
await runPar(["test-task:package-config2", "--npm-run-all-test:test=1", "--npm-run-all-test:test2=2", "--npm-run-all-test:test3=3"])
77+
assert.equal(result(), "1\n2\n3")
78+
})
6279
})
6380

64-
it("run-s command", async () => {
65-
await runSeq(["test-task:package-config2", "--npm-run-all-test:test=1", "--npm-run-all-test:test2=2", "--npm-run-all-test:test3=3"])
66-
assert(result() === "1\n2\n3")
81+
describe("CLI commands should address \"--a:b c\" style options", () => {
82+
it("npm-run-all command", async () => {
83+
await runAll(["test-task:package-config", "--npm-run-all-test:test", "OVERWRITTEN"])
84+
assert.equal(result(), "OVERWRITTEN")
85+
})
86+
87+
it("run-s command", async () => {
88+
await runSeq(["test-task:package-config", "--npm-run-all-test:test", "OVERWRITTEN"])
89+
assert.equal(result(), "OVERWRITTEN")
90+
})
91+
92+
it("run-p command", async () => {
93+
await runPar(["test-task:package-config", "--npm-run-all-test:test", "OVERWRITTEN"])
94+
assert.equal(result(), "OVERWRITTEN")
95+
})
6796
})
6897

69-
it("run-p command", async () => {
70-
await runPar(["test-task:package-config2", "--npm-run-all-test:test=1", "--npm-run-all-test:test2=2", "--npm-run-all-test:test3=3"])
71-
assert(result() === "1\n2\n3")
98+
describe("CLI commands should transfar overriting nested commands.", () => {
99+
it("npm-run-all command", async () => {
100+
await runAll(["test-task:nested-package-config", "--npm-run-all-test:test", "OVERWRITTEN"])
101+
assert.equal(result(), "OVERWRITTEN")
102+
})
103+
104+
it("run-s command", async () => {
105+
await runSeq(["test-task:nested-package-config", "--npm-run-all-test:test", "OVERWRITTEN"])
106+
assert.equal(result(), "OVERWRITTEN")
107+
})
108+
109+
it("run-p command", async () => {
110+
await runPar(["test-task:nested-package-config", "--npm-run-all-test:test", "OVERWRITTEN"])
111+
assert.equal(result(), "OVERWRITTEN")
112+
})
72113
})
73-
})
74-
75-
describe("CLI commands should address \"--a:b c\" style options", () => {
76-
it("npm-run-all command", async () => {
77-
await runAll(["test-task:package-config", "--npm-run-all-test:test", "OVERWRITTEN"])
78-
assert(result() === "OVERWRITTEN")
79-
})
80-
81-
it("run-s command", async () => {
82-
await runSeq(["test-task:package-config", "--npm-run-all-test:test", "OVERWRITTEN"])
83-
assert(result() === "OVERWRITTEN")
84-
})
85-
86-
it("run-p command", async () => {
87-
await runPar(["test-task:package-config", "--npm-run-all-test:test", "OVERWRITTEN"])
88-
assert(result() === "OVERWRITTEN")
89-
})
90-
})
91-
92-
describe("CLI commands should transfar overriting nested commands.", () => {
93-
it("npm-run-all command", async () => {
94-
await runAll(["test-task:nested-package-config", "--npm-run-all-test:test", "OVERWRITTEN"])
95-
assert(result() === "OVERWRITTEN")
96-
})
97-
98-
it("run-s command", async () => {
99-
await runSeq(["test-task:nested-package-config", "--npm-run-all-test:test", "OVERWRITTEN"])
100-
assert(result() === "OVERWRITTEN")
101-
})
102-
103-
it("run-p command", async () => {
104-
await runPar(["test-task:nested-package-config", "--npm-run-all-test:test", "OVERWRITTEN"])
105-
assert(result() === "OVERWRITTEN")
106-
})
107-
})
114+
}
108115
})

0 commit comments

Comments
 (0)