MCPcopy Index your code
hub / github.com/github-tools/github / assertSuccessful

Function assertSuccessful

test/helpers/callbacks.js:5–22  ·  view source on GitHub ↗
(done, cb)

Source from the content-addressed store, hash-verified

3const STANDARD_DELAY = 200; // 200ms between nested calls to the API so things settle
4
5export function assertSuccessful(done, cb) {
6 return function successCallback(err, res, xhr) {
7 try {
8 expect(err).not.to.exist(err ? (err.response ? err.response.data : err) : 'No error');
9 expect(res).to.exist();
10
11 if (cb) {
12 setTimeout(function delay() {
13 cb(err, res, xhr);
14 }, STANDARD_DELAY);
15 } else {
16 done();
17 }
18 } catch (e) {
19 done(e);
20 }
21 };
22}
23
24export function assertFailure(done, cb) {
25 return function failureCallback(err) {

Callers 10

auth.spec.jsFile · 0.90
project.spec.jsFile · 0.90
gist.spec.jsFile · 0.90
error.spec.jsFile · 0.90
user.spec.jsFile · 0.90
repository.spec.jsFile · 0.90
rate-limit.spec.jsFile · 0.90
issue.spec.jsFile · 0.90
assertArrayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…