-
Notifications
You must be signed in to change notification settings - Fork 1
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
Step 1 - Create UserAPI class with stub functions, tests #8
base: master
Are you sure you want to change the base?
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.
Some tests for error handling are in order, but pretty solid all in all!
src/index.test.ts
Outdated
const users = new UserAPI() | ||
const result = users.getUserById(10) | ||
|
||
expect(result).toStrictEqual( |
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.
Maybe it's best to have the returned result be a falsey value if no user is found?
src/index.ts
Outdated
|
||
export class UserAPI { | ||
users: ReadonlyArray<User> |
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.
Aron is going to say this should be private.
1. What this does:
2. Ticket:
Discussed with Aron.