scrimba
21 web dev tips for 2021 🎇
Tip 5: Unit Testing
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

AboutCommentsNotes
Tip 5: Unit Testing
Expand for more info
main.js
run
preview
console
// Unit Test

function reverse(str) {
// write code here
let splitString = str.split("")
let reverseArray = splitString.reverse()
let joinArray = reverseArray.join("")
return joinArray
}



/**
* Test Suite
*/
describe('reverse()', () => {
it('reverses a word', () => {
// arrange

// act

// log

// assert

})
})
Console
!
"Spec 'reverse() reverses a word' has no expectations."
,
/index.html
-2:39