Skip to content

Commit

Permalink
dependencies updated
Browse files Browse the repository at this point in the history
  • Loading branch information
pmcb55 committed Oct 1, 2023
1 parent aac8b7e commit fb3b590
Show file tree
Hide file tree
Showing 11 changed files with 3,036 additions and 2,820 deletions.
5,577 changes: 2,896 additions & 2,681 deletions package-lock.json

Large diffs are not rendered by default.

29 changes: 15 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,24 @@
],
"license": "MIT",
"devDependencies": {
"@types/jest": "^27.0.0",
"@typescript-eslint/eslint-plugin": "^5.46.0",
"@typescript-eslint/parser": "^5.46.0",
"eslint": "^8.29.0",
"eslint-plugin-import": "^2.26.0",
"@types/jest": "^29.5.5",
"@typescript-eslint/eslint-plugin": "^6.7.3",
"@typescript-eslint/parser": "^6.7.3",
"eslint": "^8.50.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-license-header": "^0.6.0",
"eslint-plugin-prettier": "^4.2.1",
"husky": "^8.0.2",
"jest": "^27.0.6",
"eslint-plugin-prettier": "^5.0.0",
"husky": "^8.0.3",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"license-checker": "^25.0.1",
"lint-staged": "^14.0.0",
"prettier": "^2.8.1",
"lint-staged": "^14.0.1",
"prettier": "3.0.3",
"rdf-data-factory": "^1.1.1",
"rollup": "^3.6.0",
"rollup-plugin-typescript2": "^0.35.0",
"ts-jest": "^27.0.5",
"typescript": "^4.9.4"
"rollup": "^3.29.4",
"rollup-plugin-typescript2": "^0.36.0",
"ts-jest": "^29.1.1",
"typescript": "^5.2.2"
},
"lint-staged": {
"*.ts": [
Expand Down
4 changes: 2 additions & 2 deletions src/VocabContext.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ it("should fail if no locale provided", function () {
// @ts-ignore, because the parameters of the constructor
// explicitely expect (string, IStore), to which (undef, undef) cannot
// be assigned.
() => new VocabContext(undefined, undefined)
() => new VocabContext(undefined, undefined),
).toThrowError("*MUST* be provided a locale");
});

Expand All @@ -41,7 +41,7 @@ it("should fail if no storage provided", function () {
// explicitely expect (string, IStore), to which (string, undef) cannot
// be assigned.
expect(() => new VocabContext("en", undefined)).toThrowError(
"*MUST* be provided storage"
"*MUST* be provided storage",
);
});

Expand Down
4 changes: 2 additions & 2 deletions src/VocabContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ class VocabContext {
constructor(locale: string, storage: Store) {
if (!locale) {
throw new Error(
"A new context *MUST* be provided a locale, but none was provided."
"A new context *MUST* be provided a locale, but none was provided.",
);
}
if (!storage) {
throw new Error(
`A new context *MUST* be provided storage (we expect 'localStorage').`
`A new context *MUST* be provided storage (we expect 'localStorage').`,
);
}

Expand Down
28 changes: 14 additions & 14 deletions src/VocabContextError.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ describe("Vocab context-aware errors", () => {
// @ts-ignore, because the parameters of the constructor
// explicitly expect (string, Error), to which (string, string) cannot
// be assigned.
() => new VocabContextError(context, "test", "Not an error!")
() => new VocabContextError(context, "test", "Not an error!"),
).toThrowError("test");
expect(
// @ts-ignore
() => new VocabContextError(context, "test", "Not an error!")
() => new VocabContextError(context, "test", "Not an error!"),
).toThrowError("Not an error!");
});

Expand All @@ -59,7 +59,7 @@ describe("Vocab context-aware errors", () => {
const wrapError = new VocabContextError(
context,
wrapMessage,
new Error(message)
new Error(message),
);

expect(wrapError.countLevels()).toBe(2);
Expand All @@ -74,17 +74,17 @@ describe("Vocab context-aware errors", () => {
const errorLevel1 = new VocabContextError(
context,
"Error message Level1",
undefined
undefined,
);
const errorLevel2 = new VocabContextError(
context,
"Error message Level2",
errorLevel1
errorLevel1,
);
const errorLevel3 = new VocabContextError(
context,
"Error message Level3",
errorLevel2
errorLevel2,
);
expect(errorLevel3.countLevels()).toBe(3);
const fullReport = errorLevel3.unwrapException();
Expand All @@ -98,27 +98,27 @@ describe("Vocab context-aware errors", () => {
const errorLevel1 = new VocabContextError(
context,
"Error message Level1",
undefined
undefined,
);
const errorLevel2 = new Error("Standard Error message Level2");
const errorLevel3 = new VocabContextError(
context,
"Error message Level3",
errorLevel2
errorLevel2,
);
const errorLevel4 = new VocabContextError(
context,
"Error message Level4",
errorLevel3
errorLevel3,
);

expect(errorLevel4.countLevels()).toBe(3);
const fullReport = errorLevel4.unwrapException();
expect(fullReport).not.toEqual(
expect.stringContaining(errorLevel1.message)
expect.stringContaining(errorLevel1.message),
);
expect(fullReport).toEqual(
expect.stringContaining("Standard Error message Level2")
expect.stringContaining("Standard Error message Level2"),
);
expect(fullReport).toEqual(expect.stringContaining("Error message Level3"));
expect(fullReport).toEqual(expect.stringContaining("Error message Level4"));
Expand All @@ -130,17 +130,17 @@ describe("Vocab context-aware errors", () => {
const errorLevel1 = new VocabContextError(
context,
"Error message Level1",
undefined
undefined,
);
const errorLevel2 = new VocabContextError(
context,
"Error message Level2",
errorLevel1
errorLevel1,
);
const errorLevel3 = new VocabContextError(
context,
"Error message Level3",
errorLevel2
errorLevel2,
);

expect(errorLevel3.countLevels()).toBe(3);
Expand Down
4 changes: 2 additions & 2 deletions src/VocabContextError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class VocabContextError extends Error {
constructor(
context: VocabContext,
message: string,
wrappedException?: Error
wrappedException?: Error,
) {
// The ignore is required because of code coverage bug
// https://github.com/gotwarlost/istanbul/issues/690
Expand All @@ -46,7 +46,7 @@ class VocabContextError extends Error {
this.message = `${this.message}\nContains error: ${wrappedException.message}`;
} else {
throw new Error(
`Context error can only wrap ContextErrors or Errors, but got [${wrappedException}] (message was [${message}]).`
`Context error can only wrap ContextErrors or Errors, but got [${wrappedException}] (message was [${message}]).`,
);
}
}
Expand Down
Loading

0 comments on commit fb3b590

Please sign in to comment.