testee-client
Advanced tools
Comparing version 0.5.1 to 0.5.2
{ | ||
"name": "testee-client", | ||
"version": "0.5.1", | ||
"version": "0.5.2", | ||
"description": "Testee testing framework client adapters", | ||
@@ -5,0 +5,0 @@ "main": "src/index", |
@@ -44,3 +44,24 @@ var _ = { | ||
pipe('fail', function(data, err) { | ||
var diff = self.diff(data); | ||
var diff; | ||
// Note: this is a workaround until https://github.com/bitovi/testee-client/pull/43 | ||
// can be merged. The associated server PR https://github.com/bitovi/testee/pull/163 | ||
// currently is failing to pass the tests, so #43 cannot be merged. Once that is working | ||
// working, this change should be reverted. --BM 2018-06-06 | ||
var title = data.title; | ||
if(data && data.type === "hook") { | ||
if(data.ctx.currentTest) { | ||
data = data.ctx.currentTest; | ||
} else if(data.title === '"before all" hook') { | ||
// tests in this suite will never run if before() fails, | ||
// so create the first test in order to fail it. | ||
data = data.parent.tests[0]; | ||
diff = self.diff(data); | ||
self.api['test'](diff); | ||
} else { | ||
// after all hook. apply to last test, which has already ran | ||
data = data.parent.tests[data.parent.tests.length - 1]; | ||
} | ||
} | ||
diff = self.diff(data); | ||
diff.err = { | ||
@@ -50,2 +71,3 @@ message: err.message, | ||
}; | ||
diff.title = title; | ||
return diff; | ||
@@ -52,0 +74,0 @@ }); |
@@ -15,8 +15,12 @@ var _ = { | ||
function cb() { | ||
return service[method].apply(service, args); | ||
} | ||
// Chain this service call to make sure it only runs | ||
// after all previous returned with an ACK | ||
this.connect = this.connect.then(function() { | ||
return service[method].apply(service, args); | ||
}); | ||
// after all previous returned with an ACK. | ||
// | ||
// If one fails, let it fail and error normally, | ||
// but continue with a resolved promise instead of a | ||
// rejected one. | ||
this.connect = this.connect.then(cb, cb); | ||
@@ -23,0 +27,0 @@ return this.connect; |
@@ -27,3 +27,2 @@ describe('Test module', function() { | ||
}); | ||
}); |
218
test/test.js
@@ -570,2 +570,220 @@ /* | ||
var mochaErrorsSnapshot = [{ | ||
"name": "api/runs::create", | ||
"data": { | ||
"status": "running", | ||
"environment": navigator.userAgent, | ||
"runner": "Mocha", | ||
"file": /mocha\/mocha-errors\.html/ | ||
} | ||
}, { | ||
"name": "api/suites::create", | ||
"data": { | ||
"status": "running", | ||
"title": "", | ||
"pending": false, | ||
"root": true, | ||
"file": /mocha\/mocha-errors\.html/ | ||
} | ||
}, { | ||
"name": "api/suites::create", | ||
"data": { | ||
"status": "running", | ||
"title": "mocha", | ||
"pending": false, | ||
"root": false, | ||
"file": /mocha\/mocha-errors\.html/ | ||
} | ||
}, { | ||
"name": "api/suites::create", | ||
"data": { | ||
"status": "running", | ||
"title": "Errors in setup/teardown", | ||
"pending": false, | ||
"root": false, | ||
"file": /mocha\/mocha-errors\.html/ | ||
} | ||
}, { | ||
"name": "api/suites::create", | ||
"data": { | ||
"status": "running", | ||
"title": "before", | ||
"pending": false, | ||
"root": false, | ||
"file": /mocha\/mocha-errors\.html/ | ||
} | ||
}, { | ||
"name": "api/tests::create", | ||
"data": { | ||
"title": "passes", | ||
"sync": true, | ||
"timedOut": false, | ||
//"pending": true, | ||
"type": "test", | ||
//"status": "pending", | ||
"file": /mocha\/mocha-errors\.html/ | ||
} | ||
}, { | ||
"name": "api/tests::patch", | ||
"data": { | ||
"status": "failed", | ||
"state": "failed", | ||
"title": "\"before all\" hook", | ||
"err": { | ||
"message": "Test error" | ||
} | ||
} | ||
}, { | ||
"name": "api/suites::patch", | ||
"data": { | ||
"status": "finished" | ||
} | ||
}, { | ||
"name": "api/suites::create", | ||
"data": { | ||
"status": "running", | ||
"title": "beforeEach", | ||
"pending": false, | ||
"root": false, | ||
"file": /mocha\/mocha-errors\.html/ | ||
} | ||
}, { | ||
"name": "api/tests::create", | ||
"data": { | ||
"title": "passes", | ||
"sync": true, | ||
"timedOut": false, | ||
"type": "test", | ||
"file": /mocha\/mocha-errors\.html/ | ||
} | ||
}, { | ||
"name": "api/tests::patch", | ||
"data": { | ||
"status": "failed", | ||
"state": "failed", | ||
"title": "\"before each\" hook for \"passes\"", | ||
"err": { | ||
"message": "Test error" | ||
} | ||
} | ||
}, { | ||
"name": "api/suites::patch", | ||
"data": { | ||
"status": "finished" | ||
} | ||
}, { | ||
"name": "api/suites::create", | ||
"data": { | ||
"status": "running", | ||
"title": "afterEach", | ||
"pending": false, | ||
"root": false, | ||
"file": /mocha\/mocha-errors\.html/ | ||
} | ||
}, { | ||
"name": "api/tests::create", | ||
"data": { | ||
"title": "passes", | ||
"sync": true, | ||
"timedOut": false, | ||
"type": "test", | ||
"file": /mocha\/mocha-errors\.html/ | ||
} | ||
}, { | ||
"name": "api/tests::patch", | ||
"data": { | ||
"status": "passed", | ||
"state": "passed" | ||
} | ||
}, { | ||
"name": "api/tests::patch", | ||
"data": { | ||
"status": "failed", | ||
"state": "failed", | ||
"title": "\"after each\" hook for \"passes\"", | ||
"err": { | ||
"message": "Test error" | ||
} | ||
} | ||
}, { | ||
"name": "api/suites::patch", | ||
"data": { | ||
"status": "finished" | ||
} | ||
}, { | ||
"name": "api/suites::create", | ||
"data": { | ||
"status": "running", | ||
"title": "after", | ||
"pending": false, | ||
"root": false, | ||
"file": /mocha\/mocha-errors\.html/ | ||
} | ||
}, { | ||
"name": "api/tests::create", | ||
"data": { | ||
"title": "passes", | ||
"sync": true, | ||
"timedOut": false, | ||
"type": "test", | ||
"file": /mocha\/mocha-errors\.html/ | ||
} | ||
}, { | ||
"name": "api/tests::patch", | ||
"data": { | ||
"status": "passed", | ||
"state": "passed" | ||
} | ||
}, { | ||
"name": "api/tests::patch", | ||
"data": { | ||
"status": "failed", | ||
"state": "failed", | ||
"title": "\"after all\" hook", | ||
"err": { | ||
"message": "Test error" | ||
} | ||
} | ||
}, { | ||
"name": "api/suites::patch", | ||
"data": { | ||
"status": "finished" | ||
} | ||
}, { | ||
"name": "api/suites::patch", | ||
"data": { | ||
"status": "finished" | ||
} | ||
}, { | ||
"name": "api/suites::patch", | ||
"data": { | ||
"status": "finished" | ||
} | ||
}, { | ||
"name": "api/suites::patch", | ||
"data": { | ||
"status": "finished" | ||
} | ||
}, { | ||
"name": "api/coverages::create", | ||
"data": { | ||
coverage: { | ||
"test": "Mocha coverage" | ||
} | ||
} | ||
}, { | ||
"name": "api/runs::patch", | ||
"data": { | ||
"status": "finished", | ||
"total": 6, | ||
"failed": 4, | ||
"pending": 0, | ||
"passed": 2 | ||
} | ||
}]; | ||
unit.test( | ||
'runs the Mocha test and errors as appropriate', | ||
testTester('mocha/mocha-errors.html', mochaErrorsSnapshot) | ||
); | ||
var jasmineSnapshot = [{ | ||
@@ -572,0 +790,0 @@ "name": "api/runs::create", |
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
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses eval() which is a dangerous function. This prevents the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 2 instances in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 5 instances in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
1
0
1
61163
1903