Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move support to node 16 and npm 8 #85

Merged
merged 2 commits into from
Jun 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
required: true

env:
NODE_VERSION: 14
NODE_VERSION: 'lts/*'
FORCE_COLOR: 2

jobs:
Expand All @@ -29,7 +29,7 @@ jobs:
- run: git status # getting odd dirty repo errors during version debug info
- run: git diff
- name: npm version && npm publish
uses: bcomnes/npm-bump@v2
uses: bcomnes/npm-bump@v2.0.2
with:
git_email: bcomnes@gmail.com
git_username: ${{ github.actor }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
node: [14, 12]
os: [ubuntu-latest, windows-latest, macos-latest]
node: ['lts/*', 18]

steps:
- uses: actions/checkout@v3
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"docs"
],
"engines": {
"node": ">= 10"
"node": ">= 16",
"npm": ">= 8"
},
"scripts": {
"_mocha": "mocha --timeout 120000",
Expand Down
135 changes: 71 additions & 64 deletions test/package-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
// Requirements
//------------------------------------------------------------------------------

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

beforeEach(removeResult)

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

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

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

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

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

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

it("run-p command", async () => {
await runPar(["test-task:package-config", "--npm-run-all-test:test=OVERWRITTEN"])
assert.equal(result(), "OVERWRITTEN")
})
})
})

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

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

it("run-p command", async () => {
await runPar(["test-task:package-config2", "--npm-run-all-test:test=1", "--npm-run-all-test:test2=2", "--npm-run-all-test:test3=3"])
assert.equal(result(), "1\n2\n3")
})
})

it("run-s command", async () => {
await runSeq(["test-task:package-config2", "--npm-run-all-test:test=1", "--npm-run-all-test:test2=2", "--npm-run-all-test:test3=3"])
assert(result() === "1\n2\n3")
describe("CLI commands should address \"--a:b c\" style options", () => {
it("npm-run-all command", async () => {
await runAll(["test-task:package-config", "--npm-run-all-test:test", "OVERWRITTEN"])
assert.equal(result(), "OVERWRITTEN")
})

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

it("run-p command", async () => {
await runPar(["test-task:package-config", "--npm-run-all-test:test", "OVERWRITTEN"])
assert.equal(result(), "OVERWRITTEN")
})
})

it("run-p command", async () => {
await runPar(["test-task:package-config2", "--npm-run-all-test:test=1", "--npm-run-all-test:test2=2", "--npm-run-all-test:test3=3"])
assert(result() === "1\n2\n3")
describe("CLI commands should transfar overriting nested commands.", () => {
it("npm-run-all command", async () => {
await runAll(["test-task:nested-package-config", "--npm-run-all-test:test", "OVERWRITTEN"])
assert.equal(result(), "OVERWRITTEN")
})

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

it("run-p command", async () => {
await runPar(["test-task:nested-package-config", "--npm-run-all-test:test", "OVERWRITTEN"])
assert.equal(result(), "OVERWRITTEN")
})
})
})

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

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

it("run-p command", async () => {
await runPar(["test-task:package-config", "--npm-run-all-test:test", "OVERWRITTEN"])
assert(result() === "OVERWRITTEN")
})
})

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

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

it("run-p command", async () => {
await runPar(["test-task:nested-package-config", "--npm-run-all-test:test", "OVERWRITTEN"])
assert(result() === "OVERWRITTEN")
})
})
}
})