-
Notifications
You must be signed in to change notification settings - Fork 0
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 #4
Unit tests #4
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.
Great work. Let's try to name the function on the initial describe
block.
And always check for dead code like our friend the tab space
that we found.
src/lib/util/create-link.ts
Outdated
@@ -2,10 +2,9 @@ import type { Participant } from '$lib/stores/participants-store'; | |||
|
|||
type linkParams = { participant: Participant; assignment: Participant }; | |||
|
|||
export function createLink(url: string, { participant, assignment }: linkParams): string { | |||
export function createLink(url: string, { participant, assignment }: linkParams, encode:Function = btoa): string { |
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.
Yes, now we can pass any kind of encoder we want. Let's change the name to encoder
please.
src/lib/util/shuffle-participants.ts
Outdated
@@ -10,7 +10,7 @@ export const randomizeParticipants = (participants: Participant[]): Participant[ | |||
const temp = _participants[randomIndex]; | |||
|
|||
_participants[randomIndex] = _participants[i]; | |||
_participants[i] = temp; | |||
_participants[i] = temp; |
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.
Check for the tab space
import { validateShuffle } from "./validate-shuffle"; | ||
import { demoParticipants } from '../demo-participants' | ||
|
||
describe('check that func return what we expected', () => { |
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 adding the name of the function will help better read the jest log.
Checklist
Reviewer
Changes