Functional Drum Machine Failing Last Tests

My drum machine does what it’s supposed to but the tests 6,7 and 8 aren’t picking up on it. I shelved the project a few days and built the calculator. But now I’m back at it before I attempt the pomodoro project. I’ve re-examined my code a few times over, looked at other peoples code as well as the example code and my solution seems valid so there is something I’m just not picking up on. If I had to guess I would say there is a problem with how I’ve setup the event listeners on lines 111-122 in the js section.

I appreciate any help: https://codepen.io/saclark12000/pen/KrPrdv

Thanks!

When you run the tests, the block of text in red shows the error message which shows what’s wrong (with more or less decipherability). In your case, the test returns a useful error message. You just need to look at the output of the testing suite. Oftentimes, fixing one (like 6) will fix others (like 7).


Notice that in test 5, it says “when I click”, and in test 6, it says “when I press the trigger key”, and the testing suite says the event (the keyboard event) isn’t defined, as is made clear by the folded version of your DrumMachine component, which only has a click handler.

Understood, thank you vipatron!

1 Like