Skip to content

Commit 078f10f

Browse files
committed
test: fix typescript errors
1 parent 8853d9c commit 078f10f

File tree

6 files changed

+31
-10
lines changed

6 files changed

+31
-10
lines changed

packages/mongodb-memory-server-core/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,12 @@
6363
"scripts": {
6464
"cleanup": "rimraf tmp lib coverage node_modules/.cache",
6565
"build": "npm-run-all build:*",
66-
"build:ts": "rimraf ./lib && tsc -p ./tsconfig.json",
66+
"build:ts": "rimraf ./lib && tsc -p ./tsconfig.build.json",
6767
"disabled-build:flow": "find ./lib -name \"*.d.ts\" -exec bash -c './node_modules/.bin/flowgen --add-flow-header \"$1\" -o \"${1%.d.ts}\".js.flow' - '{}' \\;",
6868
"watch": "cross-env MONGOMS_DOWNLOAD_DIR=./tmp jest --watch",
6969
"coverage": "cross-env MONGOMS_DOWNLOAD_DIR=./tmp jest --coverage",
70-
"lint": "eslint 'src/**/*.{js,ts}'",
70+
"lint": "yarn eslint && yarn tscheck",
71+
"eslint": "eslint 'src/**/*.{js,ts}'",
7172
"test": "npm run lint && npm run tscheck && npm run coverage",
7273
"tscheck": "tsc --noEmit"
7374
}

packages/mongodb-memory-server-core/src/util/__tests__/MongoBinary-test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import tmp, { SynchrounousResult } from 'tmp';
1+
import tmp, { DirResult } from 'tmp';
22
import fs from 'fs';
33
import os from 'os';
44
import MongoBinary, { LATEST_VERSION } from '../MongoBinary';
@@ -16,7 +16,7 @@ jest.mock('../MongoBinaryDownload', () => {
1616
});
1717

1818
describe('MongoBinary', () => {
19-
let tmpDir: SynchrounousResult;
19+
let tmpDir: DirResult;
2020

2121
beforeEach(() => {
2222
tmpDir = tmp.dirSync({ prefix: 'mongo-mem-bin-', unsafeCleanup: true });

packages/mongodb-memory-server-core/src/util/__tests__/MongoInstance-test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import tmp, { SynchrounousResult } from 'tmp';
1+
import tmp, { DirResult } from 'tmp';
22
import { LATEST_VERSION } from '../MongoBinary';
33
import MongodbInstance from '../MongoInstance';
44

55
jasmine.DEFAULT_TIMEOUT_INTERVAL = 600000;
66
tmp.setGracefulCleanup();
77

8-
let tmpDir: SynchrounousResult;
8+
let tmpDir: DirResult;
99
beforeEach(() => {
1010
tmpDir = tmp.dirSync({ prefix: 'mongo-mem-', unsafeCleanup: true });
1111
});

packages/mongodb-memory-server-core/src/util/__tests__/resolve-config-test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import fs from 'fs';
2-
import tmp from 'tmp';
2+
import tmp, { DirResult } from 'tmp';
33
import { promisify } from 'util';
44
import resolveConfig, { reInitializePackageJson } from '../resolve-config';
55

@@ -24,7 +24,7 @@ const innerPackageJson = {
2424

2525
describe('resolveConfig', () => {
2626
const originalDir = process.cwd();
27-
let tmpObj;
27+
let tmpObj: DirResult;
2828

2929
describe('configuration from closest package.json', () => {
3030
beforeAll(async () => {
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"compilerOptions": {
3+
"rootDir": "./src",
4+
"outDir": "./lib",
5+
"noEmit": false,
6+
"target": "es5",
7+
"module": "commonjs",
8+
"sourceMap": true,
9+
"declaration": true,
10+
"declarationMap": true,
11+
"skipLibCheck": false,
12+
"strict": true,
13+
"lib": ["es2017"],
14+
"moduleResolution": "node",
15+
"esModuleInterop": true,
16+
"forceConsistentCasingInFileNames": true,
17+
"types": ["node", "jest"]
18+
},
19+
"include": ["src/**/*"],
20+
"exclude": ["**/__tests__"]
21+
}

packages/mongodb-memory-server-core/tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,5 @@
1616
"forceConsistentCasingInFileNames": true,
1717
"types": ["node", "jest"]
1818
},
19-
"include": ["src/**/*"],
20-
"exclude": ["**/__tests__"]
19+
"include": ["src/**/*"]
2120
}

0 commit comments

Comments
 (0)