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

moderinze/refactor tests to be data-driven #1

Merged
merged 1 commit into from Jan 25, 2015

Conversation

Projects
None yet
2 participants
@garfieldnate
Contributor

garfieldnate commented Jan 25, 2015

Add basics like use strict to the tests, and move all of the test data into a JSON file. New tests can now be added by just adding new JSON data (and updating the test count).
One of the tests could not be done in JSON, so it is at the bottom of the file. However, complexity is still greatly reduced.

JSON::Tiny is used to parse the test data, but no other non-core dependencies are added.

moderinze/refactor tests to be data-driven
Add basics like `use strict` to the tests, and move all of the test data into a JSON file. New tests can now be added by just adding new
JSON data (and updating the test count). Note that one test could not
be rendered in JSON (future work?).

To handle the JSON data, use `JSON::Tiny`, which has no dependencies.
Use some core modules, as well, to find and read the file.

neilb added a commit that referenced this pull request Jan 25, 2015

Merge pull request #1 from garfieldnate/jsonTests
moderinze/refactor tests to be data-driven

@neilb neilb merged commit de17900 into neilb:master Jan 25, 2015

@neilb

This comment has been minimized.

Show comment
Hide comment
@neilb

neilb Jan 25, 2015

Owner

Hey, thanks for doing this. I've been meaning to refactor the tests ever since I adopted it, but somehow never got round to it.

Cheers!

Owner

neilb commented Jan 25, 2015

Hey, thanks for doing this. I've been meaning to refactor the tests ever since I adopted it, but somehow never got round to it.

Cheers!

@garfieldnate garfieldnate deleted the garfieldnate:jsonTests branch Feb 6, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment