File tree Expand file tree Collapse file tree 5 files changed +14
-12
lines changed Expand file tree Collapse file tree 5 files changed +14
-12
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " tinytap" ,
3- "version" : " 0.1.1 " ,
4- "description" : " Tiny tap parser and tools ." ,
5- "main" : " ./lib/tester /tester.js" ,
3+ "version" : " 0.2.0 " ,
4+ "description" : " Tiny TAP tester and test runner ." ,
5+ "main" : " ./src /tester.js" ,
66 "bin" : {
7- "tinytap" : " ./lib/testrunner /runner.js"
7+ "tinytap" : " ./src /runner.js"
88 },
99 "dependencies" : {
1010 "glob" : " ^4.0.0" ,
1111 "shell-quote" : " ^1.4.1"
1212 },
1313 "scripts" : {
14- "test" : " echo \" Error: no test specified \" && exit 1 "
14+ "test" : " cd test; ./test.sh "
1515 },
1616 "author" : " " ,
1717 "license" : " MIT" ,
File renamed without changes.
Original file line number Diff line number Diff line change @@ -4,9 +4,10 @@ var spawn = require('child_process').spawn;
44var parse = require ( 'shell-quote' ) . parse ;
55var quote = require ( 'shell-quote' ) . quote ;
66var stream = require ( 'stream' ) ;
7- var tinytap = require ( './parser.js' ) ;
87var glob = require ( 'glob' ) ;
98
9+ var tinytap = require ( '../src/parser' ) ;
10+
1011var args = process . argv . slice ( 2 ) ;
1112var list = [ [ null ] ] ;
1213
Original file line number Diff line number Diff line change 1- // tiny node-tap lookalike.
21module . exports = test
32
43var tests = module . exports . tests = [ ] ;
@@ -17,6 +16,10 @@ function test(name, fn) {
1716var assert = require ( 'assert' ) ;
1817Error . captureStackTrace = function ( ) { } ;
1918
19+ test . count = function ( n ) {
20+ console . log ( '1..' + Number ( n ) ) ;
21+ }
22+
2023var t = Object . keys ( assert ) . map ( function ( k ) {
2124 if ( typeof assert [ k ] !== 'function' ) return ;
2225 return [ k , function ( ) {
@@ -77,16 +80,14 @@ t.test = function(name, fn) {
7780 children . push ( [ name , fn ] )
7881}
7982
80- function run ( ) {
83+ function run ( ) {
8184 if ( children . length ) {
8285 tests . unshift . apply ( tests , children )
8386 children . length = 0
8487 }
8588
8689 var next = tests . shift ( ) ;
8790 if ( ! next ) {
88- console . log ( '0..' , id )
89- console . log ( '' )
9091 console . log ( '# pass' , pass , pass + fail )
9192 console . log ( '# fail' , fail , pass + fail )
9293 process . exit ( fail )
Original file line number Diff line number Diff line change 1- cat colony.tap | node index .js - > out.tap
2- cat out.tap | node index .js - > out2.tap
1+ cat colony.tap | node ../src/runner .js - > out.tap
2+ cat out.tap | node ../src/runner .js - > out2.tap
33diff out.tap out2.tap
44rm out.tap
55rm out2.tap
You can’t perform that action at this time.
0 commit comments