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

Introduce testing #169

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Introduce testing #169

wants to merge 1 commit into from

Conversation

johnholdun
Copy link
Collaborator

This patch brings Jest into the repo, adds coverage to timeSince, and provides the very beginning of a set of browser-based integration tests. The integration tests are skipped by default because they are too fragile, but can be run locally by changing describe.skip to describe.

I have no strong feelings on jest vs any other testing framework—this is just the one I've used the most. Happy to accept any alternatives!

Closes #21.

This patch brings Jest into the repo, adds coverage to timeSince, and provides the very beginning of a set of browser-based integration tests. The integration tests are skipped by default because they are too fragile, but can be run locally by changing describe.skip to describe.
"jest": true
},
"globals": {
"page": true
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think there ought to be a way to only allow this page global in *.test.js files but I'm not sure what it is

});

test('the future', () => {
expect(util.timeSince(now.valueOf() + 1000, now)).toEqual('-1s ago');
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is undesirable and basically undefined behavior, but at least now we can be confident that this is what happens!

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.

add tests
1 participant