Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
5386799
Initial plan
Copilot Feb 8, 2026
4edc25f
Replace chai and Node assert with tripwire in all tests
Copilot Feb 8, 2026
01eda52
Use deepEqual instead of deepStrictEqual for object comparisons
Copilot Feb 8, 2026
efb4f54
Auto-updated branch and resolved shrinkwrap conflict
nevware21-bot Feb 9, 2026
a58bea9
Fix TypeScript compilation errors and use strictEqual for primitives
Copilot Feb 9, 2026
32ee0ac
Merge a58bea9b4850d06e9984c7f0aa718b56755a5998 into 24345d9c85dd47772…
Copilot Feb 9, 2026
e4802ae
chore: syncing versions and shrinkwrap
nevware21-bot Feb 9, 2026
538aa00
Add explanatory comments for deepEqual usage instead of deepStrictEqual
Copilot Feb 9, 2026
bb5ecb8
Auto-updated branch and resolved shrinkwrap conflict
nevware21-bot Feb 9, 2026
cd76fac
Add explanatory comments for all deepEqual usages in tsConfig tests
Copilot Feb 10, 2026
56927c4
Merge cd76fac31484d3ee6bcaaf248a0be364b5535786 into 141f437534fafd39d…
Copilot Feb 10, 2026
8747d2a
chore: syncing versions and shrinkwrap
nevware21-bot Feb 10, 2026
3577048
Add explanatory comments for ALL deepEqual usages across all test files
Copilot Feb 10, 2026
c2e3cb0
Merge 357704811a63171537b3772204b30f96c10a7092 into 141f437534fafd39d…
Copilot Feb 10, 2026
e2e4d8f
chore: syncing versions and shrinkwrap
nevware21-bot Feb 10, 2026
d75d0bd
Add individual comments for each deepEqual assertion in multi-result …
Copilot Feb 11, 2026
b3898cf
Merge d75d0bdeac75416a6058accdc9a0f16fbfdefb93 into 141f437534fafd39d…
Copilot Feb 11, 2026
5f6259e
chore: syncing versions and shrinkwrap
nevware21-bot Feb 11, 2026
b2c4570
Add individual explanatory comments for all consecutive deepEqual ass…
Copilot Feb 11, 2026
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
498 changes: 206 additions & 292 deletions common/config/rush/npm-shrinkwrap.json

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions eslint-ts-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,11 @@
"@rollup/plugin-commonjs": "^29.0.0",
"@rollup/plugin-node-resolve": "^16.0.3",
"@rollup/plugin-json": "^6.0.1",
"@types/chai": "^4.3.16",
"@types/mocha": "^10.0.7",
"@types/node": "^25.2.2",
"@types/sinon": "^21.0.0",
"@nevware21/tripwire": ">= 0.1.6 < 2.x",
"cross-env": "^10.1.0",
"chai": "^4.4.1",
"codecov": "^3.8.3",
"mocha": "^10.5.2",
"nyc": "^17.0.0",
Expand Down
2 changes: 1 addition & 1 deletion eslint-ts-plugin/test/src/ESLintRunner.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Licensed under the MIT license.
*/

import * as assert from "assert";
import { assert } from "@nevware21/tripwire";
import { IGruntWrapper } from '@nevware21/grunt-plugins-shared-utils';
import { ESLintRunner } from '../../src/ESLintRunner';
import { IESLintRunnerOptions } from '../../src/interfaces/IESLintRunnerOptions';
Expand Down
3 changes: 1 addition & 2 deletions shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,11 @@
"rollup": "^4.6.0",
"@rollup/plugin-commonjs": "^29.0.0",
"@rollup/plugin-node-resolve": "^16.0.3",
"@types/chai": "^4.3.16",
"@types/mocha": "^10.0.7",
"@types/node": "^25.2.2",
"@types/sinon": "^21.0.0",
"@nevware21/tripwire": ">= 0.1.6 < 2.x",
"cross-env": "^10.1.0",
"chai": "^4.4.1",
"codecov": "^3.8.3",
"mocha": "^10.5.2",
"nyc": "^17.0.0",
Expand Down
21 changes: 15 additions & 6 deletions shared/test/src/fileHelper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import * as fs from "fs";
import * as os from "os";
import * as path from "path";
import { assert } from "chai";
import { assert } from "@nevware21/tripwire";
import { findCommonPath, findCommonRoot, findModulePath, getTempFile, locateModulePath, makeRelative, makeRelativeTo, normalizePath, quoteIfRequired, readJsonFile } from "../../src/fileHelpers";
import { strEndsWith, strStartsWith } from "@nevware21/ts-utils";

Expand Down Expand Up @@ -294,7 +294,9 @@ describe("fileHelpers", () => {
const content = { key: "value" };
fs.writeFileSync(filePath, JSON.stringify(content));
const result = readJsonFile(filePath);
assert.deepStrictEqual(result, content);
// Using deepEqual instead of deepStrictEqual because readJsonFile parses JSON from file,
// creating a new object instance
assert.deepEqual(result, content);
} finally {
fs.unlinkSync(filePath);
}
Expand All @@ -303,7 +305,8 @@ describe("fileHelpers", () => {
it("should return an empty object when the JSON file does not exist", () => {
const filePath = path.join(os.tmpdir(), "non-existing.json");
const result = readJsonFile(filePath);
assert.deepStrictEqual(result, {});
// Using deepEqual instead of deepStrictEqual because readJsonFile returns a new object instance
assert.deepEqual(result, {});
});

it("should return the content of the JSON file without comments when it contains comments", () => {
Expand All @@ -312,7 +315,9 @@ describe("fileHelpers", () => {
const content = { key: "value" };
fs.writeFileSync(filePath, `// This is a comment\n${JSON.stringify(content)}`);
const result = readJsonFile(filePath);
assert.deepStrictEqual(result, content);
// Using deepEqual instead of deepStrictEqual because readJsonFile parses JSON from file,
// creating a new object instance
assert.deepEqual(result, content);
} finally {
fs.unlinkSync(filePath);
}
Expand All @@ -324,7 +329,9 @@ describe("fileHelpers", () => {
const content = { key: "value" };
fs.writeFileSync(filePath, `/* This is a comment\n*/\n${JSON.stringify(content)}`);
const result = readJsonFile(filePath);
assert.deepStrictEqual(result, content);
// Using deepEqual instead of deepStrictEqual because readJsonFile parses JSON from file,
// creating a new object instance
assert.deepEqual(result, content);
} finally {
fs.unlinkSync(filePath);
}
Expand All @@ -336,7 +343,9 @@ describe("fileHelpers", () => {
const content = { key: "value" };
fs.writeFileSync(filePath, "{ \"key\": \"value\", }");
const result = readJsonFile(filePath);
assert.deepStrictEqual(result, content);
// Using deepEqual instead of deepStrictEqual because readJsonFile parses JSON from file,
// creating a new object instance
assert.deepEqual(result, content);
} finally {
fs.unlinkSync(filePath);
}
Expand Down
2 changes: 1 addition & 1 deletion shared/test/src/random.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Licensed under the MIT license.
*/

import { assert } from "chai";
import { assert } from "@nevware21/tripwire";
import { getRandomHex } from "../../src/random";

describe("random", () => {
Expand Down
108 changes: 77 additions & 31 deletions shared/test/src/tsConfigDetails.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/


import * as assert from "assert";
import { assert } from "@nevware21/tripwire";
import * as fs from "fs";
import * as path from "path";
import * as os from "os";
Expand Down Expand Up @@ -100,7 +100,9 @@ describe("getTsConfigDetails", () => {

const result = getTsConfigDetails(grunt, filePathEs5, false);
assert.equal(result.length, 1)
assert.deepStrictEqual(result[0].tsConfig, expectedContent);
// Using deepEqual instead of deepStrictEqual because getTsConfigDetails reads from file
// and creates new object instances, causing tripwire's deepStrictEqual to fail
assert.deepEqual(result[0].tsConfig, expectedContent);
});

it("should return the details of multiple tsconfig files when they exists", () => {
Expand Down Expand Up @@ -130,8 +132,12 @@ describe("getTsConfigDetails", () => {

const result = getTsConfigDetails(grunt, [ filePathEs5, filePathEs6 ], false);
assert.equal(result.length, 2)
assert.deepStrictEqual(result[0].tsConfig, expectedContent1);
assert.deepStrictEqual(result[1].tsConfig, expectedContent2);
// Using deepEqual instead of deepStrictEqual because getTsConfigDetails reads from file
// and creates new object instances, causing tripwire's deepStrictEqual to fail
assert.deepEqual(result[0].tsConfig, expectedContent1);
// Using deepEqual instead of deepStrictEqual because getTsConfigDetails reads from file
// and creates new object instances, causing tripwire's deepStrictEqual to fail
assert.deepEqual(result[1].tsConfig, expectedContent2);
});

it("should return the details of multiple tsconfig files when they exists with single compilerOptions override", () => {
Expand Down Expand Up @@ -178,8 +184,12 @@ describe("getTsConfigDetails", () => {
}],
false);
assert.equal(result.length, 2)
assert.deepStrictEqual(result[0].tsConfig, expectedContent1, "Actual:" + JSON.stringify(result[0].tsConfig, null, 2));
assert.deepStrictEqual(result[1].tsConfig, expectedContent2, "Actual:" + JSON.stringify(result[1].tsConfig, null, 2));
// Using deepEqual instead of deepStrictEqual because getTsConfigDetails reads from file
// and merges config objects with overrides, creating new object instances
assert.deepEqual(result[0].tsConfig, expectedContent1, "Actual:" + JSON.stringify(result[0].tsConfig, null, 2));
// Using deepEqual instead of deepStrictEqual because getTsConfigDetails reads from file
// and merges config objects with overrides, creating new object instances
assert.deepEqual(result[1].tsConfig, expectedContent2, "Actual:" + JSON.stringify(result[1].tsConfig, null, 2));
});

it("should return the details of multiple tsconfig files when provided with multiple variants as an array", () => {
Expand Down Expand Up @@ -226,8 +236,12 @@ describe("getTsConfigDetails", () => {
}
], false);
assert.equal(result.length, 2)
assert.deepStrictEqual(result[0].tsConfig, expectedContent1);
assert.deepStrictEqual(result[1].tsConfig, expectedContent2);
// Using deepEqual instead of deepStrictEqual because getTsConfigDetails merges config objects,
// creating new instances and potentially different property ordering
assert.deepEqual(result[0].tsConfig, expectedContent1);
// Using deepEqual instead of deepStrictEqual because getTsConfigDetails merges config objects,
// creating new instances and potentially different property ordering
assert.deepEqual(result[1].tsConfig, expectedContent2);
});

it("should return the details of multiple tsconfig files when provided with multiple variants as an iterable", () => {
Expand Down Expand Up @@ -276,8 +290,12 @@ describe("getTsConfigDetails", () => {
}
}, false);
assert.equal(result.length, 2)
assert.deepStrictEqual(result[0].tsConfig, expectedContent1);
assert.deepStrictEqual(result[1].tsConfig, expectedContent2);
// Using deepEqual instead of deepStrictEqual because getTsConfigDetails reads from file
// and merges config objects, creating new object instances
assert.deepEqual(result[0].tsConfig, expectedContent1);
// Using deepEqual instead of deepStrictEqual because getTsConfigDetails reads from file
// and merges config objects, creating new object instances
assert.deepEqual(result[1].tsConfig, expectedContent2);
});

it("should return the details of multiple tsconfig files when provided with multiple variants via an iterator", async () => {
Expand Down Expand Up @@ -327,8 +345,12 @@ describe("getTsConfigDetails", () => {
}
}, false);
assert.equal(result.length, 2)
assert.deepStrictEqual(result[0].tsConfig, expectedContent1);
assert.deepStrictEqual(result[1].tsConfig, expectedContent2);
// Using deepEqual instead of deepStrictEqual because getTsConfigDetails reads from file
// and merges config objects, creating new object instances
assert.deepEqual(result[0].tsConfig, expectedContent1);
// Using deepEqual instead of deepStrictEqual because getTsConfigDetails reads from file
// and merges config objects, creating new object instances
assert.deepEqual(result[1].tsConfig, expectedContent2);
});

it("should return the details of multiple tsconfig files when tsconfig uses the default is provided with multiple compilerOptions", () => {
Expand Down Expand Up @@ -407,10 +429,14 @@ describe("getTsConfigDetails", () => {
], false);
assert.equal(result.length, 2)
assert.equal(result[0].name, "./tsconfig.json");
assert.deepStrictEqual(result[0].tsConfig, expectedContent1);
// Using deepEqual instead of deepStrictEqual because getTsConfigDetails reads from file
// and merges config objects with overrides, creating new object instances
assert.deepEqual(result[0].tsConfig, expectedContent1);

assert.equal(result[1].name, "./tsconfig.json");
assert.deepStrictEqual(result[1].tsConfig, expectedContent2);
// Using deepEqual instead of deepStrictEqual because getTsConfigDetails reads from file
// and merges config objects with overrides, creating new object instances
assert.deepEqual(result[1].tsConfig, expectedContent2);
});

it("should return the details of multiple tsconfig files when tsconfig does not exist and is provided with multiple compilerOptions", () => {
Expand Down Expand Up @@ -451,17 +477,22 @@ describe("getTsConfigDetails", () => {
], false);
assert.equal(result.length, 2)
assert.equal(result[0].name, "./non-existing.json");
assert.deepStrictEqual(result[0].tsConfig, expectedContent1);
// Using deepEqual instead of deepStrictEqual because getTsConfigDetails merges
// config objects with overrides, creating new object instances
assert.deepEqual(result[0].tsConfig, expectedContent1);

assert.equal(result[1].name, "./non-existing.json");
assert.deepStrictEqual(result[1].tsConfig, expectedContent2);
// Using deepEqual instead of deepStrictEqual because getTsConfigDetails merges
// config objects with overrides, creating new object instances
assert.deepEqual(result[1].tsConfig, expectedContent2);
});

it("should return an empty details object when the tsconfig file does not exist", () => {
const filePath = path.join(os.tmpdir(), "non-existing.json");
const result = getTsConfigDetails(grunt, filePath, false);
assert.equal(result.length, 1)
assert.deepStrictEqual(result[0].tsConfig, {compilerOptions:{}});
// Using deepEqual instead of deepStrictEqual because getTsConfigDetails creates a new object instance
assert.deepEqual(result[0].tsConfig, {compilerOptions:{}});
});

it("should return an empty details object when the tsconfig is past as null / undefined / empty", () => {
Expand All @@ -470,45 +501,56 @@ describe("getTsConfigDetails", () => {

const result1 = getTsConfigDetails(grunt, null, false);
assert.equal(result1.length, 1, "result1: " + JSON.stringify(result1))
assert.deepStrictEqual(result1[0].tsConfig, defaultConfig, "result1: " + JSON.stringify(result1));
// Using deepEqual instead of deepStrictEqual because getTsConfigDetails reads from file
// and creates new object instances
assert.deepEqual(result1[0].tsConfig, defaultConfig, "result1: " + JSON.stringify(result1));

const result2 = getTsConfigDetails(grunt, undefined, false);
assert.equal(result2.length, 1, "result2: " + JSON.stringify(result2))
assert.deepStrictEqual(result2[0].tsConfig, defaultConfig, "result2: " + JSON.stringify(result2));
// Using deepEqual instead of deepStrictEqual because getTsConfigDetails reads from file
// and creates new object instances
assert.deepEqual(result2[0].tsConfig, defaultConfig, "result2: " + JSON.stringify(result2));

const result3 = getTsConfigDetails(grunt, "", false);
assert.equal(result3.length, 1, "result3: " + JSON.stringify(result3))
assert.deepStrictEqual(result3[0].tsConfig, defaultConfig, "result3: " + JSON.stringify(result3));
// Using deepEqual instead of deepStrictEqual because getTsConfigDetails reads from file
// and creates new object instances
assert.deepEqual(result3[0].tsConfig, defaultConfig, "result3: " + JSON.stringify(result3));
});

describe("addFiles", () => {
it("should add a single file to the tsConfig", () => {
const details = getTsConfigDetails(grunt, "tsconfig.json", false);
assert.equal(details.length, 1)
details[0].addFiles("file1.ts");
assert.deepStrictEqual(details[0].tsConfig.include, [ "./src/**/*.ts", "file1.ts" ]);
// Using deepEqual instead of deepStrictEqual because the tsConfig.include array is a new instance
assert.deepEqual(details[0].tsConfig.include, [ "./src/**/*.ts", "file1.ts" ]);
});

it("should add multiple files to the tsConfig", () => {
const details = getTsConfigDetails(grunt, "tsconfig.json", false);
assert.equal(details.length, 1)
details[0].addFiles([ "file1.ts", "file2.ts"]);
assert.deepStrictEqual(details[0].tsConfig.include, [ "./src/**/*.ts", "file1.ts", "file2.ts"]);
// Using deepEqual instead of deepStrictEqual because the tsConfig.include array is a new instance
assert.deepEqual(details[0].tsConfig.include, [ "./src/**/*.ts", "file1.ts", "file2.ts"]);
});

it("should add the files to the exclude list when they start with \"!\"", () => {
const details = getTsConfigDetails(grunt, "tsconfig.json", false);
assert.equal(details.length, 1)
details[0].addFiles(["!file1.ts", "file2.ts"]);
assert.deepStrictEqual(details[0].tsConfig.include, [ "./src/**/*.ts", "file2.ts" ]);
assert.deepStrictEqual(details[0].tsConfig.exclude, [ "node_modules/", "file1.ts" ]);
// Using deepEqual instead of deepStrictEqual because the tsConfig arrays are new instances
assert.deepEqual(details[0].tsConfig.include, [ "./src/**/*.ts", "file2.ts" ]);
// Using deepEqual instead of deepStrictEqual because the tsConfig arrays are new instances
assert.deepEqual(details[0].tsConfig.exclude, [ "node_modules/", "file1.ts" ]);
});

it("should add the files to the include list with a \"/*\" suffix when they end with \"**\"", () => {
const details = getTsConfigDetails(grunt, "tsconfig.json", false);
assert.equal(details.length, 1)
details[0].addFiles(["dir/**", "file2.ts"]);
assert.deepStrictEqual(details[0].tsConfig.include, [ "./src/**/*.ts", "dir/**/*", "file2.ts"] );
// Using deepEqual instead of deepStrictEqual because the tsConfig.include array is a new instance
assert.deepEqual(details[0].tsConfig.include, [ "./src/**/*.ts", "dir/**/*", "file2.ts"] );
});
});

Expand All @@ -518,23 +560,27 @@ describe("getTsConfigDetails", () => {
assert.equal(details.length, 1)
details[0].tsConfig = { files: ["file1.ts", "file2.ts"] };
const files = details[0].getFiles();
assert.deepStrictEqual(files, ["file1.ts", "file2.ts"]);
// Using deepEqual instead of deepStrictEqual because getFiles returns a new array instance
assert.deepEqual(files, ["file1.ts", "file2.ts"]);
});

it("should return the files from tsConfig.include when details.name is not null and tsConfig.files is null", () => {
const details = getTsConfigDetails(grunt, "tsconfig.json", false);
assert.equal(details.length, 1)
details[0].tsConfig = { include: ["file1.ts", "file2.ts"] };
const files = details[0].getFiles();
assert.deepStrictEqual(files, ["file1.ts", "file2.ts"]);
// Using deepEqual instead of deepStrictEqual because getFiles returns a new array instance
assert.deepEqual(files, ["file1.ts", "file2.ts"]);
});

it("should return an empty array when details.name is null", () => {
const details = getTsConfigDetails(grunt, null, false);
assert.equal(details.length, 1)
assert.deepStrictEqual(details[0].tsConfig.include, [ "./src/**/*.ts"]);
// Using deepEqual instead of deepStrictEqual because the tsConfig.include array is a new instance
assert.deepEqual(details[0].tsConfig.include, [ "./src/**/*.ts"]);
const files = details[0].getFiles();
assert.deepStrictEqual(files, [ "./src/**/*.ts" ]);
// Using deepEqual instead of deepStrictEqual because getFiles returns a new array instance
assert.deepEqual(files, [ "./src/**/*.ts" ]);
});
});

Expand All @@ -549,7 +595,7 @@ describe("getTsConfigDetails", () => {
assert.ok(fs.existsSync(tempName));
} finally {
arrForEach(details, (d) => d.cleanupTemp());
arrForEach(details, (d) => assert.equal(fs.existsSync(d.tempName), false));
arrForEach(details, (d) => { assert.equal(fs.existsSync(d.tempName), false); });
}
});

Expand All @@ -562,7 +608,7 @@ describe("getTsConfigDetails", () => {
assert.strictEqual(tempName, "tsconfig.json");
} finally {
arrForEach(details, (d) => d.cleanupTemp());
arrForEach(details, (d) => assert.equal(fs.existsSync(d.tempName), false));
arrForEach(details, (d) => { assert.equal(fs.existsSync(d.tempName), false); });
}
});
});
Expand Down
Loading