Feature Syntax Use Exclusive it.only, describe.only run just this while debugging Skip it.skip, describe.skip, this.skip() temporarily disable / skip at runtime Pending it("todo") with no callback placeholder shown as pending Dynamic for loop / forEach generating it calls table-driven tests Grep mocha --grep "Cart" / --fgrep run matching tests only Use --forbid-only in CI so a forgotten .only fails the build instead of silently skipping the rest of the suite. Table-driven tests keep many input/output cases readable and make adding a case a one-line change.
Key Takeaways
Generate tests in a loop for table-driven cases.
.only focuses while debugging — guard CI with --forbid-only.
A test without a callback is reported as pending.
this.skip() skips at runtime based on environment or capability.