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 Tests #3

Merged
merged 3 commits into from
Oct 17, 2020
Merged

Add Tests #3

merged 3 commits into from
Oct 17, 2020

Conversation

cmd-johnson
Copy link
Owner

Adds tests and bumps the code coverage up to 100%.

deno test --coverage --unstable still reports three untested lines, but that appears to be a bug in either the coverage reporter or the sourcemap generator, as those lines cannot not be covered:

  40 |         if (params.has("error")) {
 101 |         if (!response.ok) {
 122 |         if (body.refresh_token !== undefined &&

First, those lines are completely off.
The actual contents of those lines are:

  40 |     if (typeof this.client.config.redirectUri === "string") {
 101 |       throw new TypeError("Missing code, unable to request token");
 122 |
 ^^^ line 122 is literally empty

The lines of the reported snippets are actually on lines 95, 169 and the third one does not even exist like this in the code, as it is actually split over a few lines:

 203 |     if (
 204 |       body.refresh_token !== undefined &&
 205 |       typeof body.refresh_token !== "string"
 206 |     ) {

Anyway, when modifying any of those statement's control flows, tests fail, so I can assume those lines are actually relevant and covered by the tests failing in those scenarios.

Close #1

@cmd-johnson cmd-johnson merged commit 7136add into master Oct 17, 2020
@cmd-johnson cmd-johnson added this to the v0.1.0 milestone Oct 19, 2020
@cmd-johnson cmd-johnson deleted the feature/tests branch October 19, 2020 10:49
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