Skip to content

Commit

Permalink
Update flight.request calls
Browse files Browse the repository at this point in the history
  • Loading branch information
ingalls committed Sep 29, 2021
1 parent a87c68e commit 2e55751
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion api/test/cache.srv.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ test('DELETE: api/cache/data', async (t) => {
headers: {
'shared-secret': '123'
}
});
}, t);

t.deepEquals(res.body, {
status: 200,
Expand Down
10 changes: 5 additions & 5 deletions api/test/exporter.srv.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ test('POST /api/export - cannot export unsuccessful', async (t) => {
job_id: 1,
format: 'csv'
}
});
}, false);

t.equals(exp.statusCode, 400, 'http: 400');

Expand Down Expand Up @@ -141,7 +141,7 @@ test('POST /api/export - no donor level', async (t) => {
job_id: 1,
format: 'csv'
}
});
}, false);

t.deepEquals(exp.body, {
status: 403,
Expand Down Expand Up @@ -240,7 +240,7 @@ test('GET /api/export/100 - backer', async (t) => {
},
method: 'GET',
json: true
});
}, false);

t.deepEquals(exp.body, { status: 404, message: 'no exports by that id', messages: [] });
} catch (err) {
Expand Down Expand Up @@ -296,7 +296,7 @@ test('GET /api/export/1 - backer', async (t) => {
bearer: flight.token.backer
},
json: true
});
}, t);

t.ok(exp.body.created, '.created: <date>');
delete exp.body.created;
Expand Down Expand Up @@ -332,7 +332,7 @@ test('POST /api/export - backer - exceeded limit', async (t) => {
job_id: 1,
format: 'csv'
}
});
}, false);

t.equals(exp.statusCode, 400, 'http: 400');

Expand Down
4 changes: 2 additions & 2 deletions api/test/job_error.srv.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ test('GET: api/job/error', async (t) => {
url: 'http://localhost:4999/api/job/error',
method: 'GET',
json: true
});
}, false);

t.equals(res.statusCode, 404, 'http: 404');

Expand All @@ -295,7 +295,7 @@ test('GET: api/job/error/1', async (t) => {
url: 'http://localhost:4999/api/job/error/1',
method: 'GET',
json: true
});
}, false);

t.equals(res.statusCode, 404, 'http: 404');

Expand Down
2 changes: 1 addition & 1 deletion api/test/level-override.srv.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ test('GET: api/level/2', async (t) => {
auth: {
bearer: flight.token.admin
}
});
}, false);

t.deepEquals(res.body, {
status: 404,
Expand Down
6 changes: 3 additions & 3 deletions api/test/user.srv.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test('GET: api/user (no auth)', async (t) => {
url: 'http://localhost:4999/api/user',
method: 'GET',
json: true
});
}, false);
t.equals(res.statusCode, 403, 'http: 403');
} catch (err) {
t.error(err, 'no error');
Expand Down Expand Up @@ -63,7 +63,7 @@ test('POST: api/login (failed)', async (t) => {
username: 'ingalls',
password: 'password124'
}
});
}, false);

t.equals(res.statusCode, 403, 'http: 403');
} catch (err) {
Expand All @@ -83,7 +83,7 @@ test('POST: api/login (not confirmed)', async (t) => {
username: 'ingalls',
password: 'password123'
}
});
}, false);

t.equals(res.statusCode, 403, 'http: 403');
t.deepEquals(res.body, {
Expand Down

0 comments on commit 2e55751

Please sign in to comment.