For anyone else running into this issue, the class or constructor function needs to be exported, otherwise you will get this error. Just had to debug it myself.
Okay, so here’s what I think is happening and why there is confusion:
As @Bargs has noticed, the class that you define for this exercise, as well as the functions, need to be exported for the test runner to be able to see them and run the tests against them.
Usually the stub we provide in the beginning includes some scaffolding and the proper names of things to be exported, but this one doesn’t. It does however have a comment that reminds you to export your class but i assume that got deleted and forgotten somewhere in the process of solving the exercise.
@SleeplessByte Any idea if the stub is empty on purpose or has it just been forgotten? Do we need to add some scaffolding?
Also, @Bargs if you’re exporting your constructor and each method on their own, that’s not the best way to do it since you lose some of the benefits of the class (not that it’s obvious in this exercise). Instead, export the whole class and it should be fine.
Yeah, it was on purpose. I think it’s fine. It explicitly says to export it.
We may need a new exercise in-between to “teach” this better though!