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

Consistent way of writing unit tests #1543

Closed
fedekunze opened this issue Nov 8, 2018 · 5 comments · Fixed by #1580
Closed

Consistent way of writing unit tests #1543

fedekunze opened this issue Nov 8, 2018 · 5 comments · Fixed by #1580
Assignees
Labels

Comments

@fedekunze
Copy link
Contributor

Description:

There are currently two ways we're doing unit testing:

  1. describe() and it() (eg: PageStaking.spec.js)
  2. test() (eg: DelegationModal.spec.js)

We should stick with one or another, so we'd have to choose either 1. or 2., update our coding guidelines with the decision and do a refactor of our unit tests.

@NodeGuy
Copy link
Contributor

NodeGuy commented Nov 8, 2018

I used test in DelegationModal because it's the default in Jest before I saw that we are using it elsewhere. I'm happy for us to use it consistently.

@fedekunze
Copy link
Contributor Author

I like it more as well

@faboweb
Copy link
Collaborator

faboweb commented Nov 9, 2018

I like how the jasmine syntax reads more like a real description (spec):

it should return an object property x when I give it input y

@faboweb
Copy link
Collaborator

faboweb commented Nov 9, 2018

@jbibla how comes you think this is such a complex task?

@jbibla
Copy link
Collaborator

jbibla commented Nov 9, 2018

i suppose if we're only changing test to it then all the tests should pass and it will be a bunny rabbit task not an elephant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants