Skip to content

Commit d8c4b90

Browse files
authored
test: replace leche helper function with native forEach (#83)
1 parent 69235ac commit d8c4b90

File tree

4 files changed

+7
-12
lines changed

4 files changed

+7
-12
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
strategy:
2626
matrix:
2727
os: [ubuntu-latest]
28-
node: [25,x, 24.x, 22.x, 20.x, 18.x]
28+
node: [25.x, 24.x, 22.x, 20.x, 18.x]
2929
runs-on: ${{ matrix.os }}
3030
steps:
3131
- uses: actions/checkout@v5

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
"eslint": "^9.36.0",
4444
"eslint-config-eslint": "^13.0.0",
4545
"globals": "^16.4.0",
46-
"leche": "^2.3.0",
4746
"mocha": "^6.1.4",
4847
"sinon": "^1.17.2"
4948
},

tests/lib/release-ops.test.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
const assert = require("node:assert"),
1515
fs = require("node:fs"),
16-
leche = require("leche"),
1716
os = require("node:os"),
1817
path = require("node:path"),
1918
sinon = require("sinon"),
@@ -26,8 +25,7 @@ const assert = require("node:assert"),
2625
describe("ReleaseOps", () => {
2726

2827
describe("getPrereleaseVersion()", () => {
29-
30-
leche.withData([
28+
[
3129
["1.0.0", "alpha", "major", "2.0.0-alpha.0"],
3230
["1.0.0", "alpha", "minor", "1.1.0-alpha.0"],
3331
["1.0.0", "alpha", "patch", "1.0.1-alpha.0"],
@@ -37,10 +35,9 @@ describe("ReleaseOps", () => {
3735
["2.0.0-alpha.0", "alpha", "patch", "2.0.0-alpha.1"],
3836

3937
["2.0.0-alpha.1", "beta", "patch", "2.0.0-beta.0"]
38+
].forEach(([version, prereleaseId, releaseType, expected]) => {
4039

41-
], (version, prereleaseId, releaseType, expected) => {
42-
43-
it("should return the correct next version", () => {
40+
it(`(with ${version}, ${prereleaseId}, ${releaseType}, ${expected}) should return the correct next version`, () => {
4441
const result = ReleaseOps.getPrereleaseVersion(version, prereleaseId, releaseType);
4542

4643
assert.strictEqual(result, expected);

tests/lib/shell-ops.test.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
const assert = require("node:assert"),
1515
sinon = require("sinon"),
1616
path = require("node:path"),
17-
leche = require("leche"),
1817
ShellOps = require("../../lib/shell-ops");
1918

2019
//------------------------------------------------------------------------------
@@ -34,13 +33,13 @@ describe("ShellOps", () => {
3433
assert.strictEqual(env.PATH, `${NODE_MODULES_PATH};${PATH}`);
3534
});
3635

37-
leche.withData([
36+
[
3837
"darwin",
3938
"freebsd",
4039
"linux",
4140
"sunos"
42-
], platform => {
43-
it("should modify path correctly when on Unix OS", () => {
41+
].forEach(platform => {
42+
it(`(with ${platform}) should modify path correctly when on Unix OS`, () => {
4443
const env = ShellOps.getModifiedEnv(platform);
4544

4645
assert.strictEqual(env.PATH, `${NODE_MODULES_PATH}:${PATH}`);

0 commit comments

Comments
 (0)