Skip to content

Commit

Permalink
dependencies(jest): upgrade to 27.0.5 (and related)
Browse files Browse the repository at this point in the history
  • Loading branch information
hasezoey committed Jun 25, 2021
1 parent f804224 commit e7f43a3
Show file tree
Hide file tree
Showing 7 changed files with 835 additions and 1,178 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "3.4.0",
"husky": "6.0.0",
"jest": "26.6.3",
"jest": "27.0.5",
"lerna": "4.0.0",
"lint-staged": "10.5.4",
"prettier": "2.3.1",
"semantic-release": "17.4.4",
"ts-jest": "26.5.2",
"ts-jest": "27.0.3",
"typescript": "4.3.4"
},
"workspaces": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import * as utils from '../util/utils';
import { MongoMemoryInstanceOpts } from '../util/MongoInstance';
import { StateError } from '../util/errors';

jasmine.DEFAULT_TIMEOUT_INTERVAL = 100000;
jest.setTimeout(100000); // 10s

afterEach(() => {
jest.restoreAllMocks();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import * as semver from 'semver';
import { StateError } from '../util/errors';

tmp.setGracefulCleanup();
jasmine.DEFAULT_TIMEOUT_INTERVAL = 100000;
jest.setTimeout(100000); // 10s

afterEach(() => {
jest.restoreAllMocks();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import MongoMemoryReplSet from '../MongoMemoryReplSet';
import { MongoClient } from 'mongodb';

jasmine.DEFAULT_TIMEOUT_INTERVAL = 100000;
jest.setTimeout(100000); // 10s

describe('multi-member replica set', () => {
it('should enter running state', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import MongodbInstance, { MongoInstanceEvents } from '../MongoInstance';
import resolveConfig, { ResolveConfigVariables } from '../resolveConfig';
import getPort from 'get-port';

jasmine.DEFAULT_TIMEOUT_INTERVAL = 100000;
jest.setTimeout(100000); // 10s
tmp.setGracefulCleanup();

let tmpDir: tmp.DirResult;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ describe('utils', () => {
jest.spyOn(process, 'kill').mockImplementationOnce(() => {
throw new Error('hello');
});
jest.useFakeTimers(); // fake times to have spies on "setTimeout" (and ensure they never get run)
jest.spyOn(global, 'setTimeout');
// the "useFakeTimers" seems to be brocken in jest@27.0.5 & ts-jest@27.0.3
// tracking issue: https://github.com/facebook/jest/issues/11564
// jest.useFakeTimers(); // fake times to have spies on "setTimeout" (and ensure they never get run)

await utils.killProcess({ pid: 1001 } as ChildProcess, 'test');
expect(process.kill).toHaveBeenCalledWith(1001, 0);
Expand Down
Loading

0 comments on commit e7f43a3

Please sign in to comment.