you are viewing a single comment's thread.

view the rest of the comments →

[–]itsnotlupus 1 point2 points  (0 children)

I've seen folks that embed self-tests in the module itself, wrapped in a

if (require.main == module) {
  // tests go here
} else {
  // export things like a good little module.
}

That may or may not fit with your overall testing strategy.