TAPE(1)
π TAPE(1) π
okay bestie, welcome to tape(1) β the manual page. yes it's a man page. yes it's also a whole vibe. let's get into it π«Ά
β¨ NAME β¨
tape β a tap-producing test harness for node and browsers. it's giving "tiny library, enormous main character energy" π
πΈ SYNOPSIS πΈ
tape [-r module] [file] [file ...]
π¦ DESCRIPTION π¦
tape is a tap-producing test harness for node and browsers that needs literally only a few lines of code. no cap. you can use it for unit testing and integration testing, it's versatile like that β¨
tape will execute the test described by the file option. by default, file gets interpreted using the glob module. so yeah, you might need to quote file to keep your shell from doing its own globbing first β your shell is nosy, we love her, but still π
tests are written in pure javascript, so tests could be run using Node.js. periodt.
π OPTIONS π
-r,--requireβ load one or more modules before running any tests. β οΈ heads up bestie: all modules loaded with the-rflag will run before any tests, no matter when you specify them. like,tape -r a b -r cwill actually loadaandcbefore loadingb, becauseaandcare flagged as required modules. the ordering is not what your eyes think it is, iykyk π-i,--ignoreβ ignore tests from certain folders and/or files that are not intended to be run. it defaults to the.gitignorefile when passed with no argument. for example:
tape -i .ignore **/*.js`
--no-onlyβ this is particularly useful in a CI environment where an "only test" is not supposed to go unnoticed. π by passing the--no-onlyflag, any existing "only test" causes tests to fail:
tape --no-only **/*.js`
alternatively, the environment variable NODE_TAPE_NO_ONLY_TEST can be set to true to achieve the same behavior; the command-line flag takes precedence. π
π METHODS π
the assertion methods in tape are heavily influenced or copied from the methods in node-tap. iconic lineage honestly π
var test = require('tape')
π EXAMPLES π
tape 'tests/**/*.js'
tape -r './my/local/module' 'tests/**/*.js'
tape -r 'babel-register' 'tests/**/*.js'
β SEE ALSO β
and that's the whole page bestie!! π this one's from tape(1), dated 8/4/17 β so when you're out here running your tests, remember: slay, tap, and don't forget to quote your globs π¦β¨π
π¦ where this page comes from
- debian bookworm: node-tape 5.6.1+~cs8.20.19-1 Β· MIT
- debian trixie: node-tape 5.6.1+~cs8.20.19-3 Β· MIT
- ubuntu noble: node-tape 5.6.1+~cs8.20.19-1 Β· MIT
- ubuntu questing: node-tape 5.6.1+~cs8.20.19-3
- ubuntu resolute: node-tape 5.6.1+~cs8.20.19-5 Β· MIT
- ubuntu stonking: node-tape 5.6.1+~cs8.20.19-6 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms