scotch-tape
Helps write adhesive tape tests and better organize your test code.
Code
var scotchTape = ;var test = ;
Supported Options:
setup
- Optional - called before any tests starts runningbefore
- Optional -called before every test runafter
- Optional -called after every test runteardown
- Optional -called after all the tests are runasserts
- Optional - custom local assertions
scotch-tape flavor
Initialization
'use strict'; var scotchTape = ; var test = ;
Sample Tests
;
Console Output
TAP version 13
# setup
setup
# Project Tests > should pass 1
Before Each
ok 1 (unnamed assert)
After Each
# Project Tests > should pass 2
Before Each
ok 2 (unnamed assert)
After Each
# teardown
teardown
1..2
# tests 2
# pass 2
# ok
Custom Global Tape Asserts
You can overload tape js tests to include custom assertions.
'use strict'; var scotchTapeAsserts = ; var scotchTape = ;
Sample Tests
var runBasicTests = ; ;
Console Output
TAP version 13
# Global Tape Asserts > should handle type
ok 1 should be equal
# Global Tape Asserts > should handle length
ok 2 should be equal
1..2
# tests 2
# pass 2
# ok
ENJOY WRITING BETTER TESTS