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

[jest-each] Migrate to Typescript #8007

Merged
merged 5 commits into from
Feb 28, 2019
Merged

Conversation

mattphillips
Copy link
Contributor

Summary

This PR moves jest-each to TS as part of #7807

Test plan

  • Unit tests pass
  • e2e still passes

@mattphillips mattphillips requested a review from SimenB February 28, 2019 17:48
@mattphillips mattphillips force-pushed the jest-each-ts branch 2 times, most recently from c31ce47 to 0731192 Compare February 28, 2019 17:58
@SimenB SimenB added this to the TypeScript Migration milestone Feb 28, 2019
Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woo, awesome!

My only comment really is that there's a lot of any here that doesn't have to be. Could you look into narrowing the types? At least replace with unknown as much as possible.

Also, please add jest-each to https://github.com/facebook/jest/blob/1b2fffa9f13a67e54441606fda75822064cee57e/packages/jest-circus/tsconfig.json and remove the ts-ignore in there

@@ -15,8 +14,8 @@ import {ErrorWithStack} from 'jest-util';

type Table = Array<Array<any>>;
type PrettyArgs = {
args: Array<mixed>,
title: string,
args: Array<any>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
args: Array<any>;
args: Array<unknown>;

if it doesn't cause huge issues 🙂

@@ -26,7 +25,7 @@ const PRETTY_PLACEHOLDER = '%p';
const INDEX_PLACEHOLDER = '%#';

export default (cb: Function, supportsDone: boolean = true) => (...args: any) =>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export default (cb: Function, supportsDone: boolean = true) => (...args: any) =>
export default (cb: Function, supportsDone: boolean = true) => (...args: Array<unknown>) =>

or at least Array<any>


const install = (g: GlobalCallbacks, ...args: Array<mixed>) => {
const test = (title: string, test: Function, timeout: number) =>
const install = (g: Global, ...args: Array<any>) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const install = (g: Global, ...args: Array<any>) => {
const install = (g: Global, ...args: Array<unknown>) => {

@codecov-io
Copy link

Codecov Report

Merging #8007 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8007      +/-   ##
==========================================
- Coverage   64.18%   64.18%   -0.01%     
==========================================
  Files         259      259              
  Lines       10141    10143       +2     
  Branches     1753     1770      +17     
==========================================
+ Hits         6509     6510       +1     
  Misses       3246     3246              
- Partials      386      387       +1
Impacted Files Coverage Δ
packages/jest-each/src/bind.ts 98.85% <100%> (ø)
packages/jest-each/src/index.ts 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1b2fffa...0731192. Read the comment docs.

@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants