-
Notifications
You must be signed in to change notification settings - Fork 7
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
Unit tests #78
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
} 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; | ||
} |
There was a problem hiding this comment.
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.....
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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!
A few basic unit tests for the utility js we wrote.
Run by doing
node --test
.