Skip to content

Commit

Permalink
upgrade dev dependencies and drop support for node.js 12
Browse files Browse the repository at this point in the history
  • Loading branch information
Francesco Rivola committed Apr 9, 2022
1 parent 0b2bafd commit d8e1b83
Show file tree
Hide file tree
Showing 8 changed files with 2,073 additions and 5,809 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

strategy:
matrix:
node-version: [12.x, 14.x, 16.x]
node-version: [14.x, 16.x, 17.x]

steps:
- uses: actions/checkout@v1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/npmpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 16
node-version: 14
- run: npm ci
- run: npm run build
- run: npm run lint
Expand All @@ -30,7 +30,7 @@ jobs:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12
node-version: 14
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run build
Expand Down
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"cSpell.words": [
"Forgetter"
]
}
7,838 changes: 2,047 additions & 5,791 deletions package-lock.json

Large diffs are not rendered by default.

21 changes: 12 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,21 @@
"fire-and-forget",
"lib"
],
"engines": {
"node": ">=14"
},
"author": "francescorivola",
"license": "MIT",
"homepage": "https://github.com/francescorivola/fire-and-forgetter#readme",
"devDependencies": {
"@types/jest": "^27.0.0",
"@types/node": "^17.0.0",
"@typescript-eslint/eslint-plugin": "^2.23.0",
"@typescript-eslint/parser": "^2.23.0",
"codecov": "^3.6.1",
"eslint": "^6.8.0",
"jest": "^25.1.0",
"ts-jest": "^25.0.0",
"typescript": "^3.6.4"
"@types/jest": "^27.4.1",
"@types/node": "^14.18.12",
"@typescript-eslint/eslint-plugin": "^5.18.0",
"@typescript-eslint/parser": "^5.18.0",
"codecov": "^3.8.3",
"eslint": "^8.13.0",
"jest": "^27.5.1",
"ts-jest": "^27.1.4",
"typescript": "^4.6.3"
}
}
2 changes: 1 addition & 1 deletion src/fire-and-forgetter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export function fireAndForgetter(options: Options = defaultOptions): FireAndForg
*/
function close(closeOptions: CloseOptions = { timeout: 0 }): Promise<void> {
closing = true;
return new Promise((resolve, reject) => {
return new Promise<void>((resolve, reject) => {
if (counter.getCount() === 0) {
resolve();
return;
Expand Down
6 changes: 3 additions & 3 deletions test/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe("fire-and-forgetter", () => {
await fireAndForget.close({ timeout: 10 });
} catch (error) {
expect(error instanceof TimeoutClosingError).toBe(true);
expect(error.message).toBe("Cannot close after 10ms, 3 fire and forget operations are still in progress");
expect((error as Error).message).toBe("Cannot close after 10ms, 3 fire and forget operations are still in progress");
expect(count).toBe(0);
}
});
Expand All @@ -78,7 +78,7 @@ describe("fire-and-forgetter", () => {

fireAndForget(() => doSumeSuffAndReject(), (error) => {
expect(error instanceof Error).toBe(true);
expect(error.message).toBe("ups, some error happened");
expect((error as Error).message).toBe("ups, some error happened");
});

await fireAndForget.close();
Expand Down Expand Up @@ -120,7 +120,7 @@ describe("fire-and-forgetter", () => {
fireAndForget(() => doSumeSuffAndIncrementCountAtTheEnd());
} catch (error) {
expect(error instanceof ClosingError).toBe(true);
expect(error.message).toBe("Cannot longer execute fire and forget operation as is closing or closed");
expect((error as Error).message).toBe("Cannot longer execute fire and forget operation as is closing or closed");
}
});
});
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
],
"compilerOptions": {
"module": "commonjs",
"target": "es2018",
"target": "es2020",
"noImplicitAny": false,
"declaration": true,
"sourceMap": true,
"outDir": "build",
"watch": false,
"lib": [
"es2018"
"es2020"
],
"moduleResolution": "node",
"noUnusedLocals": true,
Expand Down

0 comments on commit d8e1b83

Please sign in to comment.