Jest: Use property initializer syntax in Jest codebase

Created on 10 Feb 2019  路  5Comments  路  Source: facebook/jest

From https://github.com/facebook/jest/pull/7844#discussion_r255326815

It'd be nice to avoid bind(this) and constructor assignments. We need to add https://babeljs.io/docs/en/babel-plugin-proposal-class-properties and go through the code to figure out where we could use it

Help Wanted good first issue

All 5 comments

Hi @SimenB I'm interested in working in this issue! Where's a good place to start looking for breadcrumbs?

@peanutenthusiast If you're using vscode, you can start by using the global search command + shift + f and look for .bind(this). That should get the ball rolling

You can take a look at https://github.com/facebook/jest/pull/7881 as well

Note that #8117 didn't change the unnecessary constructor assignments mentioned in the OP, just binds. (Good enough for me though, the binds are what's most annoying)

It's _in_ now, so we can start using it, and fixing different parts as we come over them

Was this page helpful?
0 / 5 - 0 ratings