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

Testing 1/3: Add a bunch of unit tests #135

Merged
merged 7 commits into from
Sep 7, 2018

Conversation

mikrostew
Copy link
Contributor

As the first part of improving the testing for Notion, I have added a bunch of unit tests.

Next up is creating an acceptance testing harness to tackle #7.

@mikrostew mikrostew force-pushed the unit-tests branch 3 times, most recently from caa37f1 to de81fda Compare August 28, 2018 22:45
Copy link
Collaborator

@dherman dherman left a comment

Choose a reason for hiding this comment

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

Just a couple FIXME comments. Otherwise this looks awesome.

@@ -24,6 +24,7 @@ pub struct NodeDistro {

/// Check if the cached file is valid. It may have been corrupted or interrupted in the middle of
/// downloading.
// FIXME(#134) - verify checksum
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for citing an issue! Let's use consistent formatting and write ISSUE(#134) instead of FIXME.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -108,6 +108,7 @@ Options:
}
}

// FIXME: all the logic here should be moved to notion-core
Copy link
Collaborator

Choose a reason for hiding this comment

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

One last FIXME left :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -166,3 +181,173 @@ where
Ok(bin_map)
}
}

#[cfg(test)]
pub mod tests {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't have a strong opinion either way, but you could consider splitting these out into a separate file. You'd create a manifest/ subdirectory, move manifest.rs into manifest/mod.rs, split out this module into manifest/test.rs, and then change this code to

#[cfg(test)]
pub mod tests;

But I don't know if that's better or worse, just a thought.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea. And since you already refactored manifest.rs to manifest/mod.rs, this is an easy change

Copy link
Collaborator

@dherman dherman left a comment

Choose a reason for hiding this comment

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

At long last—take that, 32-bit msvc. 🕺

@dherman dherman merged commit 48a8dd8 into volta-cli:master Sep 7, 2018
@mikrostew mikrostew deleted the unit-tests branch December 13, 2018 17:58
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.

2 participants