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

Add test suite + test example for JS #20

Merged
merged 13 commits into from
Dec 16, 2022

Conversation

luizcieslak
Copy link
Contributor

@luizcieslak luizcieslak commented Oct 26, 2020

Using jest as the test engine.

Also add a test for the function, asserting it's maxSize argument.

Closes #17

Copy link
Owner

@MattIPv4 MattIPv4 left a comment

Choose a reason for hiding this comment

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

As noted in the issue, this should be fully testing the behaviour of the generate method, but also the private methods involved in the generation process.

See the Ruby gem test suite for inspiration: https://github.com/MattIPv4/do_username/blob/master/ruby/spec/do_username_spec.rb

@luizcieslak
Copy link
Contributor Author

luizcieslak commented Oct 29, 2020

sorry @MattIPv4, did not pay attention to that. I add all the tests the ruby package does expect for the srand one.

Besides that, I did the following:

  • Add constants.js to make mock possible. See 1, 2 for more info

  • export private functions in module in order to test them too

  • combineUsername throwing error related to maxSize

  • fix merge conflicts with master

  • fix eslint errors after its implementation

@luizcieslak luizcieslak requested a review from MattIPv4 October 29, 2020 22:04
.gitignore Outdated Show resolved Hide resolved
javascript/__tests__/do_username.test.js Outdated Show resolved Hide resolved
javascript/lib/do_username.js Outdated Show resolved Hide resolved
javascript/lib/do_username.js Outdated Show resolved Hide resolved
@luizcieslak luizcieslak requested a review from MattIPv4 October 30, 2020 12:12
@luizcieslak luizcieslak requested a review from MattIPv4 October 30, 2020 12:39
Copy link
Owner

@MattIPv4 MattIPv4 left a comment

Choose a reason for hiding this comment

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

Sorry for not getting to this sooner, not sure why I lost track of updates here a while back. LGTM, tyvm!

@MattIPv4 MattIPv4 changed the title add test suite and test example for JS Add test suite + test example for JS Dec 16, 2022
@MattIPv4 MattIPv4 merged commit e0bcbc2 into MattIPv4:master Dec 16, 2022
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.

JavaScript: Add test suite
2 participants