How do I throw an error for my gitlab runner from this custom Javascript test suite?

Heya,

I have a package that is doing a lot of tests, but this isn’t a Mocha test or a Tape test framework, or Selenium or anything like that.

I have to figure out how to make this test package fail the test build the same way it would fail with Mocha or any other standard test library out there. Right now I have it so that if there are any failed tests, it exits the process with code 1. This should signify an error – but the Gitlab Runner doesn’t notice this!

How does Mocha or any other Javascript test runner take care of this?