karma-tap
Advanced tools
Comparing version 1.0.4 to 2.0.0
@@ -0,1 +1,3 @@ | ||
var path = require('path'); | ||
var createPattern = function(path) { | ||
@@ -6,4 +8,4 @@ return {pattern: path, included: true, served: true, watched: false}; | ||
var initTAP = function(files, tapConfig) { | ||
files.unshift(createPattern(__dirname + '/src/adapter.js')); | ||
files.unshift(createPattern(__dirname + '/src/tap-parser.js')); | ||
files.unshift(createPattern(__dirname + '/src/adapter.js')); | ||
files.unshift(createPattern(__dirname + '/lib/parser.js')); | ||
}; | ||
@@ -10,0 +12,0 @@ |
{ | ||
"name": "karma-tap", | ||
"version": "1.0.4", | ||
"version": "2.0.0", | ||
"description": "adapter from karma to the tape testing framework", | ||
"main": "index.js", | ||
"scripts": { | ||
"clean": "rimraf lib", | ||
"build:parser": "browserify src/parser.js --s tapParser -o lib/parser.js", | ||
"build-npm": "npm run clean && mkdirp lib && npm run build:parser", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
@@ -21,9 +24,16 @@ }, | ||
"author": "Tom MacWright", | ||
"contributors": [ | ||
"bySabi Files <> (https://github.com/bySabi)" | ||
], | ||
"license": "ISC", | ||
"peerDependencies": { | ||
"karma": "1.x.x" | ||
}, | ||
"devDependencies": { | ||
"karma": "^0.12.28" | ||
}, | ||
"dependencies": { | ||
"tap-parser": "^1.2.2" | ||
"browserify": "13.x.x", | ||
"tap-parser": "1.x.x", | ||
"tap-finished": "0.0.1", | ||
"mkdirp": "*", | ||
"rimraf": "*" | ||
} | ||
} |
# Karma TAP adapter | ||
This adapter reads [TAP](http://testanything.org/) output from runners like | ||
[tape](https://github.com/substack/tape) into [Karma](http://karma-runner.github.io/0.12/index.html). | ||
[tape](https://github.com/substack/tape) into [Karma](http://karma-runner.github.io/1.0/index.html) | ||
@@ -25,1 +25,4 @@ ## Installation | ||
``` | ||
## TAP Protocol | ||
Support TAP Protocol version `13` |
@@ -1,59 +0,77 @@ | ||
var createStartFn = function(tc, env) { | ||
var numResults = 0; | ||
var res = []; | ||
var startTime = new Date().getTime(); | ||
var parse_stream = tapParser(function(results) { | ||
tc.info({ total: numResults }); | ||
for (var i = 0, len = res.length; i < len; i++) { | ||
tc.result(res[i]); | ||
} | ||
tc.complete({ | ||
coverage: window.__coverage__ | ||
// global object tapParser from 'parser.js' | ||
var finished = tapParser.finished; | ||
var parser = tapParser.parser; | ||
function createStartFn(tc) { | ||
return function(config) { | ||
var numResults = 0; | ||
var done = false; | ||
var res = []; | ||
var suite = ''; | ||
var startTime = new Date().getTime(); | ||
var parse_stream = parser(); | ||
var skip = /^# SKIP\s/; | ||
parse_stream.on('comment', function(comment) { | ||
// handle skipped test | ||
if (skip.test(comment)) { | ||
res.push({ | ||
description: comment.replace(skip, ''), | ||
skipped: true | ||
}); | ||
return; | ||
} | ||
// TODO: validate if comment is a test 'name' | ||
suite = comment; | ||
}); | ||
}).on('assert', function(assertion) { | ||
numResults++; | ||
res.push({ | ||
description: assertion.name, | ||
success: assertion.ok, | ||
log: [JSON.stringify(assertion.diag || assertion, null, 2)], | ||
suite: [], | ||
time: new Date().getTime() - startTime | ||
parse_stream.on('assert', function(assertion) { | ||
numResults++; | ||
res.push({ | ||
description: assertion.name, | ||
success: assertion.ok, | ||
log: [JSON.stringify(assertion.diag || assertion, null, 2)], | ||
suite: [suite], | ||
time: new Date().getTime() - startTime | ||
}); | ||
}); | ||
}); | ||
// this part lifted from zuul | ||
// https://github.com/defunctzombie/zuul/blob/master/frameworks/tape/client.js | ||
var originalLog = console.log; | ||
console.log = function (msg) { | ||
if (!parse_stream.writable) return; | ||
var index = 1; | ||
var args = arguments; | ||
if (typeof msg === 'string') { | ||
msg = msg.replace(/(^|[^%])%[sd]/g, function (_, s) { | ||
return s + args[index++]; | ||
parse_stream.on('complete', function(results) { | ||
tc.info({ total: numResults }); | ||
for (var i = 0, len = res.length; i < len; i++) { | ||
tc.result(res[i]); | ||
} | ||
tc.complete({ | ||
coverage: window.__coverage__ | ||
}); | ||
} | ||
}); | ||
for (var i = index; i < args.length; i++) { | ||
msg += ' ' + args[i]; | ||
} | ||
parse_stream.write(msg + '\n'); | ||
if (/^# fail\s*\d+$/.test(msg) || /^# ok/.test(msg)) { | ||
// reset console.log to make sure this stream doesn't get a write error. | ||
console.log = originalLog; | ||
// this part lifted from zuul | ||
// https://github.com/defunctzombie/zuul/blob/master/frameworks/tape/client.js | ||
var finished_stream = finished(function() { | ||
done = true; | ||
parse_stream.end(); | ||
} | ||
}); | ||
if (typeof originalLog === 'function') { | ||
return originalLog.apply(this, arguments); | ||
var originalLog = console.log; | ||
console.log = function () { | ||
var msg = arguments[0]; | ||
// do not write in a closed WriteStream | ||
if (!done) { | ||
parse_stream.write(msg + '\n'); | ||
finished_stream.write(msg + '\n'); | ||
} | ||
// transfer log to original console, | ||
// this shows the tap output in console | ||
// and also let the user add console logs | ||
if (typeof originalLog === 'function') { | ||
return originalLog.apply(this, arguments); | ||
} | ||
} | ||
else if (originalLog) return originalLog(arguments[0]); | ||
}; | ||
return function(config) { | ||
}; | ||
} | ||
}; | ||
window.__karma__.start = createStartFn(window.__karma__); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
9
28
301562
5
8845
10
+ Addedaccepts@1.3.3(transitive)
+ Addedafter@0.8.2(transitive)
+ Addedanymatch@1.3.2(transitive)
+ Addedarr-diff@2.0.04.0.0(transitive)
+ Addedarr-flatten@1.1.0(transitive)
+ Addedarr-union@3.1.0(transitive)
+ Addedarray-slice@0.2.3(transitive)
+ Addedarray-unique@0.2.10.3.2(transitive)
+ Addedarraybuffer.slice@0.0.6(transitive)
+ Addedassign-symbols@1.0.0(transitive)
+ Addedasync-each@1.0.6(transitive)
+ Addedatob@2.1.2(transitive)
+ Addedbacko2@1.0.2(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbase@0.11.2(transitive)
+ Addedbase64-arraybuffer@0.1.5(transitive)
+ Addedbase64id@1.0.0(transitive)
+ Addedbetter-assert@1.0.2(transitive)
+ Addedbinary-extensions@1.13.1(transitive)
+ Addedbindings@1.5.0(transitive)
+ Addedblob@0.0.4(transitive)
+ Addedbluebird@3.7.2(transitive)
+ Addedbody-parser@1.20.3(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedbraces@0.1.51.8.52.3.2(transitive)
+ Addedbuffer-alloc@1.2.0(transitive)
+ Addedbuffer-alloc-unsafe@1.1.0(transitive)
+ Addedbuffer-fill@1.0.0(transitive)
+ Addedbytes@3.1.2(transitive)
+ Addedcache-base@1.0.1(transitive)
+ Addedcall-bind@1.0.7(transitive)
+ Addedcallsite@1.0.0(transitive)
+ Addedchokidar@1.7.0(transitive)
+ Addedclass-utils@0.3.6(transitive)
+ Addedcollection-visit@1.0.0(transitive)
+ Addedcolors@1.4.0(transitive)
+ Addedcombine-lists@1.0.1(transitive)
+ Addedcomponent-bind@1.0.0(transitive)
+ Addedcomponent-emitter@1.1.21.2.11.3.1(transitive)
+ Addedcomponent-inherit@0.0.3(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedconnect@3.7.0(transitive)
+ Addedcontent-type@1.0.5(transitive)
+ Addedcookie@0.3.1(transitive)
+ Addedcopy-descriptor@0.1.1(transitive)
+ Addedcore-js@2.6.12(transitive)
+ Addedcustom-event@1.0.1(transitive)
+ Addeddebug@2.2.02.3.32.6.9(transitive)
+ Addeddecode-uri-component@0.2.2(transitive)
+ Addeddefine-data-property@1.1.4(transitive)
+ Addeddefine-property@0.2.51.0.02.0.2(transitive)
+ Addeddepd@2.0.0(transitive)
+ Addeddestroy@1.2.0(transitive)
+ Addeddi@0.0.1(transitive)
+ Addeddom-serialize@2.2.1(transitive)
+ Addedee-first@1.1.1(transitive)
+ Addedencodeurl@1.0.2(transitive)
+ Addedengine.io@1.8.3(transitive)
+ Addedengine.io-client@1.8.3(transitive)
+ Addedengine.io-parser@1.3.2(transitive)
+ Addedent@2.2.1(transitive)
+ Addedes-define-property@1.0.0(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedescape-html@1.0.3(transitive)
+ Addedeventemitter3@4.0.7(transitive)
+ Addedexpand-braces@0.1.2(transitive)
+ Addedexpand-brackets@0.1.52.1.4(transitive)
+ Addedexpand-range@0.1.11.8.2(transitive)
+ Addedextend@3.0.2(transitive)
+ Addedextend-shallow@2.0.13.0.2(transitive)
+ Addedextglob@0.3.22.0.4(transitive)
+ Addedfile-uri-to-path@1.0.0(transitive)
+ Addedfilename-regex@2.0.1(transitive)
+ Addedfill-range@2.2.44.0.0(transitive)
+ Addedfinalhandler@1.1.2(transitive)
+ Addedfollow-redirects@1.15.9(transitive)
+ Addedfor-in@1.0.2(transitive)
+ Addedfor-own@0.1.5(transitive)
+ Addedfragment-cache@0.2.1(transitive)
+ Addedfs.realpath@1.0.0(transitive)
+ Addedfsevents@1.2.13(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-intrinsic@1.2.4(transitive)
+ Addedget-value@2.0.6(transitive)
+ Addedglob@7.2.3(transitive)
+ Addedglob-base@0.3.0(transitive)
+ Addedglob-parent@2.0.0(transitive)
+ Addedgopd@1.0.1(transitive)
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedhas-binary@0.1.7(transitive)
+ Addedhas-cors@1.1.0(transitive)
+ Addedhas-property-descriptors@1.0.2(transitive)
+ Addedhas-proto@1.0.3(transitive)
+ Addedhas-symbols@1.0.3(transitive)
+ Addedhas-value@0.3.11.0.0(transitive)
+ Addedhas-values@0.1.41.0.0(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedhttp-errors@2.0.0(transitive)
+ Addedhttp-proxy@1.18.1(transitive)
+ Addediconv-lite@0.4.24(transitive)
+ Addedindexof@0.0.1(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedis-accessor-descriptor@1.0.1(transitive)
+ Addedis-binary-path@1.0.1(transitive)
+ Addedis-buffer@1.1.6(transitive)
+ Addedis-data-descriptor@1.0.1(transitive)
+ Addedis-descriptor@0.1.71.0.3(transitive)
+ Addedis-dotfile@1.0.3(transitive)
+ Addedis-equal-shallow@0.1.3(transitive)
+ Addedis-extendable@0.1.11.0.1(transitive)
+ Addedis-extglob@1.0.0(transitive)
+ Addedis-glob@2.0.1(transitive)
+ Addedis-number@0.1.12.1.03.0.04.0.0(transitive)
+ Addedis-plain-object@2.0.4(transitive)
+ Addedis-posix-bracket@0.1.1(transitive)
+ Addedis-primitive@2.0.0(transitive)
+ Addedis-windows@1.0.2(transitive)
+ Addedisarray@0.0.1(transitive)
+ Addedisbinaryfile@3.0.3(transitive)
+ Addedisobject@2.1.03.0.1(transitive)
+ Addedjson3@3.3.2(transitive)
+ Addedkarma@1.7.1(transitive)
+ Addedkind-of@3.2.24.0.06.0.3(transitive)
+ Addedlodash@3.10.14.17.21(transitive)
+ Addedlog4js@0.6.38(transitive)
+ Addedlru-cache@4.1.5(transitive)
+ Addedmap-cache@0.2.2(transitive)
+ Addedmap-visit@1.0.0(transitive)
+ Addedmath-random@1.0.4(transitive)
+ Addedmedia-typer@0.3.0(transitive)
+ Addedmicromatch@2.3.113.1.10(transitive)
+ Addedmime@1.6.0(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedminimatch@3.1.2(transitive)
+ Addedminimist@0.0.10(transitive)
+ Addedmixin-deep@1.3.2(transitive)
+ Addedms@0.7.10.7.22.0.0(transitive)
+ Addednan@2.22.0(transitive)
+ Addednanomatch@1.2.13(transitive)
+ Addednegotiator@0.6.1(transitive)
+ Addednormalize-path@2.1.1(transitive)
+ Addedobject-assign@4.1.0(transitive)
+ Addedobject-component@0.0.3(transitive)
+ Addedobject-copy@0.1.0(transitive)
+ Addedobject-inspect@1.13.2(transitive)
+ Addedobject-visit@1.0.1(transitive)
+ Addedobject.omit@2.0.1(transitive)
+ Addedobject.pick@1.3.0(transitive)
+ Addedon-finished@2.3.02.4.1(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedoptimist@0.6.1(transitive)
+ Addedoptions@0.0.6(transitive)
+ Addedos-tmpdir@1.0.2(transitive)
+ Addedparse-glob@3.0.4(transitive)
+ Addedparsejson@0.0.3(transitive)
+ Addedparseqs@0.0.5(transitive)
+ Addedparseuri@0.0.5(transitive)
+ Addedparseurl@1.3.3(transitive)
+ Addedpascalcase@0.1.1(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedposix-character-classes@0.1.1(transitive)
+ Addedpreserve@0.2.0(transitive)
+ Addedpseudomap@1.0.2(transitive)
+ Addedpunycode@1.4.1(transitive)
+ Addedqjobs@1.2.0(transitive)
+ Addedqs@6.13.0(transitive)
+ Addedrandomatic@3.1.1(transitive)
+ Addedrange-parser@1.2.1(transitive)
+ Addedraw-body@2.5.2(transitive)
+ Addedreadable-stream@1.0.34(transitive)
+ Addedreaddirp@2.2.1(transitive)
+ Addedregex-cache@0.4.4(transitive)
+ Addedregex-not@1.0.2(transitive)
+ Addedremove-trailing-separator@1.1.0(transitive)
+ Addedrepeat-element@1.1.4(transitive)
+ Addedrepeat-string@0.2.21.6.1(transitive)
+ Addedrequires-port@1.0.0(transitive)
+ Addedresolve-url@0.2.1(transitive)
+ Addedret@0.1.15(transitive)
+ Addedrimraf@2.7.1(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedsafe-regex@1.1.0(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsemver@4.3.6(transitive)
+ Addedset-function-length@1.2.2(transitive)
+ Addedset-value@2.0.1(transitive)
+ Addedsetprototypeof@1.2.0(transitive)
+ Addedside-channel@1.0.6(transitive)
+ Addedsnapdragon@0.8.2(transitive)
+ Addedsnapdragon-node@2.1.1(transitive)
+ Addedsnapdragon-util@3.0.1(transitive)
+ Addedsocket.io@1.7.3(transitive)
+ Addedsocket.io-adapter@0.5.0(transitive)
+ Addedsocket.io-client@1.7.3(transitive)
+ Addedsocket.io-parser@2.3.1(transitive)
+ Addedsource-map@0.5.7(transitive)
+ Addedsource-map-resolve@0.5.3(transitive)
+ Addedsource-map-url@0.4.1(transitive)
+ Addedsplit-string@3.1.0(transitive)
+ Addedstatic-extend@0.1.2(transitive)
+ Addedstatuses@1.5.02.0.1(transitive)
+ Addedstring_decoder@0.10.31(transitive)
+ Addedtmp@0.0.31(transitive)
+ Addedto-array@0.1.4(transitive)
+ Addedto-object-path@0.3.0(transitive)
+ Addedto-regex@3.0.2(transitive)
+ Addedto-regex-range@2.1.1(transitive)
+ Addedtoidentifier@1.0.1(transitive)
+ Addedtype-is@1.6.18(transitive)
+ Addedultron@1.0.2(transitive)
+ Addedunion-value@1.0.1(transitive)
+ Addedunpipe@1.0.0(transitive)
+ Addedunset-value@1.0.0(transitive)
+ Addedurix@0.1.0(transitive)
+ Addeduse@3.1.1(transitive)
+ Addeduseragent@2.3.0(transitive)
+ Addedutils-merge@1.0.1(transitive)
+ Addedvoid-elements@2.0.1(transitive)
+ Addedwordwrap@0.0.3(transitive)
+ Addedwrappy@1.0.2(transitive)
+ Addedws@1.1.2(transitive)
+ Addedwtf-8@1.0.0(transitive)
+ Addedxmlhttprequest-ssl@1.5.3(transitive)
+ Addedyallist@2.1.2(transitive)
+ Addedyeast@0.1.2(transitive)
- Removedtap-parser@^1.2.2
- Removedargparse@1.0.10(transitive)
- Removedesprima@4.0.1(transitive)
- Removedevents-to-array@1.1.2(transitive)
- Removedjs-yaml@3.14.1(transitive)
- Removedsprintf-js@1.0.3(transitive)
- Removedtap-parser@1.3.2(transitive)