![]() Generate an assertion that will be skipped over. t.timeoutAfter(ms)Īutomatically timeout the test after X ms. Generate a passing assertion with a message msg. Generate a failing assertion with a message msg. ![]() Useful for undoing side effects, closing network connections, etc. Multiple registered teardown callbacks will run in order. Register a callback to run after the individual test has completed. If err is passed in t.end will assert that it is falsy.ĭo not call t.end() if your test callback returns a Promise. t.end(err)ĭeclare the end of a test explicitly. If there are any more assertions after the nth, or after t.end() is called, they will generate errors. ![]() t.end() will be called automatically after the nth assertion. t.plan(n)ĭeclare that n assertions should be run. The onFailure hook will get invoked whenever any tape tests has failed.įn is called with no arguments, and its return value is ignored. The onFinish hook will get invoked when ALL tape tests have finished right before tape is about to print the test summary.įn is called with no arguments, and its return value is ignored. Generate a new test that will be skipped over. Explicitly calling t.end() while also returning a Promise that fulfills is an error. If that promise rejects, the test will be failed if it fulfills, the test will end. If cb returns a Promise, it will be implicitly awaited. If you forget to t.plan() out how many assertions you are going to run and you don't call t.end() explicitly, or return a Promise that eventually settles, your test will hang. Environmental variable NODE_TAPE_OBJECT_PRINT_DEPTH can set the desired default depth for all tests locally-set values will take precedence. Configure max depth of expected / actual object printing. Set a timeout for the test, after which it will fail. Var test = require ( 'tape' ) test(,, cb)Ĭreate a new test with an optional name string and optional opts object.Ĭb(t) fires with the new test object t once all preceding tests have finished. gitignore file when passed with no argument. This flag is used when tests from certain folders and/or files are not intended to be run. This is used to load modules before running tests and is explained extensively in the preloading modules section. While running tests, top-level configurations can be passed via the command line to specify desired behavior.Īvailable configurations are listed below: -require
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |