Skip to content

Commit

Permalink
chore(deps): update to nock 13 (googleapis#2259)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeckwith authored Jul 6, 2020
1 parent 62f8193 commit 6086f28
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"mocha": "^8.0.0",
"mv": "^2.1.1",
"ncp": "^2.0.0",
"nock": "^12.0.0",
"nock": "^13.0.0",
"nunjucks": "^3.2.1",
"open": "^7.0.0",
"p-queue": "^6.0.0",
Expand Down
25 changes: 15 additions & 10 deletions test/test.options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,22 +227,27 @@ describe('Options', () => {
const res2 = await drive.files.list({}, {responseType: 'stream'});
assert.ok(res2.data.resume);

// It is ok to use callbacks here, and recognize the results won't be
// tested before the test completes.
// This is here purely to test TypeScript types.

// callback for json
drive.files.list({}, (err, res) => {
assert.ok(res?.data.etag);
await new Promise(resolve => {
drive.files.list({}, (err, res) => {
assert.ok(res?.data.etag);
resolve();
});
});

// callback with no params
drive.files.list((err, res) => {
assert.ok(res?.data.etag);
await new Promise(resolve => {
drive.files.list((err, res) => {
assert.ok(res?.data.etag);
resolve();
});
});

drive.files.list({}, {responseType: 'stream'}, (err, res) => {
assert.ok(res?.data.resume);
await new Promise(resolve => {
drive.files.list({}, {responseType: 'stream'}, (err, res) => {
assert.ok(res?.data.resume);
resolve();
});
});

scope.done();
Expand Down

0 comments on commit 6086f28

Please sign in to comment.