@somewhatabstract/x 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -37
- package/dist/x.mjs +13 -20
- package/package.json +6 -3
- package/.changeset/README.md +0 -8
- package/.changeset/config.json +0 -11
- package/.github/codeql/codeql-config.yml +0 -5
- package/.github/dependabot.yml +0 -28
- package/.github/workflows/codeql-analysis.yml +0 -71
- package/.github/workflows/dependabot-pr-approval.yml +0 -36
- package/.github/workflows/nodejs.yml +0 -129
- package/.github/workflows/release.yml +0 -95
- package/.vscode/settings.json +0 -19
- package/CHANGELOG.md +0 -23
- package/CODE_OF_CONDUCT.md +0 -76
- package/CONTRIBUTING.md +0 -70
- package/biome.json +0 -39
- package/src/__tests__/build-environment.test.ts +0 -285
- package/src/__tests__/discover-packages.test.ts +0 -196
- package/src/__tests__/errors.test.ts +0 -59
- package/src/__tests__/execute-script.test.ts +0 -1042
- package/src/__tests__/find-matching-bins.test.ts +0 -506
- package/src/__tests__/find-workspace-root.test.ts +0 -73
- package/src/__tests__/is-node-executable.test.ts +0 -125
- package/src/__tests__/resolve-bin-path.test.ts +0 -344
- package/src/__tests__/x-impl.test.ts +0 -314
- package/src/__tests__/x.test.ts +0 -236
- package/src/bin/x.ts +0 -57
- package/src/build-environment.ts +0 -98
- package/src/discover-packages.ts +0 -35
- package/src/errors.ts +0 -10
- package/src/execute-script.ts +0 -56
- package/src/find-matching-bins.ts +0 -72
- package/src/find-workspace-root.ts +0 -24
- package/src/is-node-executable.ts +0 -16
- package/src/resolve-bin-path.ts +0 -48
- package/src/x-impl.ts +0 -96
- package/tsconfig-types.json +0 -5
- package/tsconfig.json +0 -21
- package/tsdown.config.ts +0 -24
- package/vitest.config.ts +0 -10
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import {describe, expect, it} from "vitest";
|
|
2
|
-
import {HandledError} from "../errors";
|
|
3
|
-
|
|
4
|
-
describe("HandledError", () => {
|
|
5
|
-
it("should be an instance of Error", () => {
|
|
6
|
-
// Arrange
|
|
7
|
-
const error = new HandledError("Test error message");
|
|
8
|
-
|
|
9
|
-
// Act
|
|
10
|
-
const isError = error instanceof Error;
|
|
11
|
-
|
|
12
|
-
// Assert
|
|
13
|
-
expect(isError).toBe(true);
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
it("should have name 'HandledError'", () => {
|
|
17
|
-
// Arrange
|
|
18
|
-
const error = new HandledError("Test error message");
|
|
19
|
-
|
|
20
|
-
// Act
|
|
21
|
-
const name = error.name;
|
|
22
|
-
|
|
23
|
-
// Assert
|
|
24
|
-
expect(name).toBe("HandledError");
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
it("should preserve the error message", () => {
|
|
28
|
-
// Arrange
|
|
29
|
-
const message = "Test error message";
|
|
30
|
-
|
|
31
|
-
// Act
|
|
32
|
-
const error = new HandledError(message);
|
|
33
|
-
|
|
34
|
-
// Assert
|
|
35
|
-
expect(error.message).toBe(message);
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
it("should be distinguishable from HandledError type", () => {
|
|
39
|
-
// Arrange
|
|
40
|
-
const handledError = new HandledError("Handled");
|
|
41
|
-
|
|
42
|
-
// Act
|
|
43
|
-
const isHandledError = handledError instanceof HandledError;
|
|
44
|
-
|
|
45
|
-
// Assert
|
|
46
|
-
expect(isHandledError).toBe(true);
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
it("should distinguish regular errors from HandledError type", () => {
|
|
50
|
-
// Arrange
|
|
51
|
-
const regularError = new Error("Regular");
|
|
52
|
-
|
|
53
|
-
// Act
|
|
54
|
-
const isHandledError = regularError instanceof HandledError;
|
|
55
|
-
|
|
56
|
-
// Assert
|
|
57
|
-
expect(isHandledError).toBe(false);
|
|
58
|
-
});
|
|
59
|
-
});
|