Skip to content

Commit

Permalink
Update TS config. Fix Mocha
Browse files Browse the repository at this point in the history
Upstream Mocha types have issues so disabled checks for libraries.
  • Loading branch information
peterjenkins1 committed Oct 10, 2024
1 parent 5096553 commit 470f824
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
5 changes: 3 additions & 2 deletions tests/mocha.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Knex, knex } from 'knex';
import { before, after, describe, it } from 'mocha';

import * as assert from "assert";
import { Model } from "objection";
Expand All @@ -16,7 +17,7 @@ describe("testPerTransaction", () => {
it("can access models during test", async () => {
await Item.query().insert({});
const count = await Item.query().count();
assert.equal(count[0]["count(*)"], 1);
assert.equal((count[0] as any)["count(*)"], 1);
});

it("rolls back transaction after tests", async () => {
Expand All @@ -25,7 +26,7 @@ describe("testPerTransaction", () => {

after(async () => {
const count = await Item.query().count();
assert.equal(count[0]["count(*)"], 0);
assert.equal((count[0] as any)["count(*)"], 0);
});
});

Expand Down
13 changes: 7 additions & 6 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"compilerOptions": {
"allowJs": false,
"target": "es2017",
"lib": ["es2015", "es6", "es2017", "esnext.asynciterable"],
"module": "commonjs",
"moduleResolution": "node",
"target": "es2023",
"lib": ["es2023"],
"module": "NodeNext",
"moduleResolution": "NodeNext",
"declaration": true,
"outDir": "./dist",
"strict": false,
"esModuleInterop": true
"strict": true,
"skipLibCheck": true

},
"files": ["index.ts"]
}

0 comments on commit 470f824

Please sign in to comment.