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

Refactor options processor v2 #4492

Merged
merged 29 commits into from
Dec 24, 2018
Merged

Refactor options processor v2 #4492

merged 29 commits into from
Dec 24, 2018

Conversation

henrikra
Copy link
Contributor

@henrikra henrikra commented Dec 23, 2018

Goal of this PR

The goal of this PR is to make OptionsProcessor.ts great again 🇺🇸 . To me it was total mess including tests.

What was wrong or funky?

  1. the tests tested if React Native's processColor color works as it should even though react native has multiple tests for this. Aka we don't have to test React Native's functions :D
  2. LayoutTreeCrawler.test.ts was testing OptionsProcessors functionality so it was removed now
  3. Lots of small things since this was done before putting noImplicitAny to true so it wasn't made TypeScript in mind

Result

Now OptionsProcessor.ts should be

  1. code way more clear
  2. tests are testing only things that they should
  3. tests are written in clear way
  4. it is easy to see from the tests what the whole function does
  5. type safe for TypeScript noImplicitAny (when we actually turn it on)

@henrikra henrikra changed the title [WIP] Refactor options processor v2 Refactor options processor v2 Dec 24, 2018
@guyca
Copy link
Collaborator

guyca commented Dec 24, 2018

Looks great! I'll merge 👍

@guyca guyca merged commit ee04610 into wix:master Dec 24, 2018
vshkl pushed a commit to vshkl/react-native-navigation that referenced this pull request Feb 5, 2020
## Goal of this PR
The goal of this PR is to make `OptionsProcessor.ts` great again 🇺🇸 . To me it was total mess including tests. 

## What was wrong or funky?
1. the tests tested if React Native's `processColor` color works as it should even though react native has [multiple tests for this](https://github.com/facebook/react-native/blob/master/Libraries/StyleSheet/__tests__/processColor-test.js). Aka we don't have to test React Native's functions :D
2. `LayoutTreeCrawler.test.ts` was testing `OptionsProcessor`s functionality so it was removed now
3. Lots of small things since this was done before putting `noImplicitAny` to true so it wasn't made TypeScript in mind

## Result
Now `OptionsProcessor.ts` should be
1. code way more clear
2. tests are testing only things that they should
3. tests are written in clear way
4. it is easy to see from the tests what the whole function does
5. type safe for TypeScript `noImplicitAny` (when we actually turn it on)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants