Filtering Mocha tests

1 · Gleb Bahmutov · Sept. 1, 2019, 2:21 a.m.
Imagine you have Mocha unit tests, like these ones12345it('test a', () => {})it('test b', () => {})it('test c', () => {})You can run these tests by installing Mocha1234$ npm i mocha+ [email protected] 1 package and audited 226 packages in 5.338sfound 0 vulnerabilitiesand then running the command12345678$ npx mocha ./spec.js ✓ test a ✓ test b ✓ test c 3 passing (4ms)Beautiful, but what if we want to change the list of collected tests before running them? What if we want to filter tests and m...