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

Unit tests #78

Merged
merged 3 commits into from
Feb 26, 2024
Merged

Unit tests #78

merged 3 commits into from
Feb 26, 2024

Conversation

mdellabitta
Copy link
Contributor

A few basic unit tests for the utility js we wrote.

Run by doing node --test.

@mdellabitta mdellabitta requested a review from a team as a code owner February 26, 2024 19:23
@mdellabitta mdellabitta requested review from bensteinberg and removed request for a team February 26, 2024 19:23
Copy link
Contributor

@bensteinberg bensteinberg left a comment

Choose a reason for hiding this comment

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

👍

@mdellabitta mdellabitta merged commit 469746b into harvard-lil:main Feb 26, 2024
1 check passed
@mdellabitta mdellabitta deleted the unit-tests branch February 26, 2024 19:53
} else if (Array.isArray(obj) || typeof obj === "string") {
return obj.length === 0;
} else if (
["boolean", "number", "bigint", "symbol", "function"].includes(typeof obj)
) {
throw new Error(f`Unsuported type: ${typeof obj}`);
throw new Error(`Unsuported type: ${typeof obj}`);
} else {
return Object.keys(obj).length === 0;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh dear, I am such a python programmer.....

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, and I missed a typo!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Crap, I'll put up another PR!

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.

3 participants