Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update to [email protected] #10859

Merged
merged 4 commits into from
Feb 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion e2e/runJest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ export const runContinuous = function (
},

async waitUntil(fn: ConditionFunction) {
await new Promise(resolve => {
await new Promise<void>(resolve => {
const check = (state: StdErrAndOutString) => {
if (fn(state)) {
pending.delete(check);
Expand Down
4 changes: 2 additions & 2 deletions packages/jest-circus/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export const callAsyncCircusFn = (

const {fn, asyncError} = testOrHook;

return new Promise((resolve, reject) => {
return new Promise<void>((resolve, reject) => {
timeoutID = setTimeout(
() => reject(_makeTimeoutMessage(timeout, isHook)),
timeout,
Expand Down Expand Up @@ -266,7 +266,7 @@ export const callAsyncCircusFn = (
returnedValue !== null &&
typeof returnedValue.then === 'function'
) {
returnedValue.then(resolve, reject);
returnedValue.then(() => resolve(), reject);
return;
}

Expand Down
6 changes: 2 additions & 4 deletions packages/jest-jasmine2/src/PCancelable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class CancelError extends Error {
}
}

export default class PCancelable<T> extends Promise<T> {
export default class PCancelable<T> implements PromiseLike<T> {
private _pending = true;
private _canceled = false;
private _promise: Promise<T>;
Expand All @@ -22,12 +22,10 @@ export default class PCancelable<T> extends Promise<T> {
constructor(
executor: (
onCancel: (cancelHandler: () => void) => void,
resolve: (value?: T | PromiseLike<T>) => void,
resolve: (value: T | PromiseLike<T>) => void,
reject: (reason?: unknown) => void,
) => void,
) {
super(resolve => resolve());

this._promise = new Promise((resolve, reject) => {
this._reject = reject;

Expand Down
2 changes: 1 addition & 1 deletion packages/jest-snapshot/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const validateSnapshotVersion = (snapshotContents: string) => {
};

function isObject(item: unknown): boolean {
return item && typeof item === 'object' && !Array.isArray(item);
return item != null && typeof item === 'object' && !Array.isArray(item);
}

export const testNameToKey = (testName: Config.Path, count: number): string =>
Expand Down
4 changes: 2 additions & 2 deletions packages/pretty-format/src/plugins/ReactElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {

// Given element.props.children, or subtree during recursive traversal,
// return flattened array of children.
const getChildren = (arg: Array<unknown>, children = []) => {
const getChildren = (arg: unknown, children: Array<unknown> = []) => {
if (Array.isArray(arg)) {
arg.forEach(item => {
getChildren(item, children);
Expand Down Expand Up @@ -115,7 +115,7 @@ export const serialize: NewPlugin['serialize'] = (
);

export const test: NewPlugin['test'] = (val: unknown) =>
val && ReactIs.isElement(val);
val != null && ReactIs.isElement(val);

const plugin: NewPlugin = {serialize, test};

Expand Down
12 changes: 6 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -19408,22 +19408,22 @@ [email protected]:
linkType: hard

"typescript@*, typescript@^4.0.2, typescript@^4.0.3":
version: 4.0.5
resolution: "typescript@npm:4.0.5"
version: 4.1.5
resolution: "typescript@npm:4.1.5"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: ce94d4bbb914cc9d6fbd42e1476ab18c3292b262b8ba7ba76cd167a858545207a604e75bf1efbb75b8654c8f85deaa19795c3ef00098d7612855139b4ecc0240
checksum: 29157c84426ac94ce97aac836264f303a26bd9fb30865650229e3406a36ca2e89735ef4b8878075ba1b95fa4d3ff9810057b64888700c28e20b4034a6db4da83
languageName: node
linkType: hard

"typescript@patch:typescript@*#builtin<compat/typescript>, typescript@patch:typescript@^4.0.2#builtin<compat/typescript>, typescript@patch:typescript@^4.0.3#builtin<compat/typescript>":
version: 4.0.5
resolution: "typescript@patch:typescript@npm%3A4.0.5#builtin<compat/typescript>::version=4.0.5&hash=cc6730"
version: 4.1.5
resolution: "typescript@patch:typescript@npm%3A4.1.5#builtin<compat/typescript>::version=4.1.5&hash=cc6730"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: ada6fea7657a51d1b842682d31233e53a3cf509b0edbd6288fda3cfd01643d0190b7ea77837527c4d282c90e61690e19dbfd91be6913e7e7292aa0b588d3506c
checksum: 58cc7786be0f8485c124944883b1384287532e4867ec37f1fb5cb2811dbc10f7a9decccad89097f924043285f3515bfd8223c61dbb4f88af00b2d8dc2ef73207
languageName: node
linkType: hard

Expand Down