Skip to content

Commit

Permalink
test: use strictEqual in tests (#1246)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeckwith committed Jul 25, 2018
1 parent 9ff9724 commit c15ffef
Show file tree
Hide file tree
Showing 13 changed files with 214 additions and 232 deletions.
52 changes: 11 additions & 41 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/samples/test.samples.youtube.ts
Expand Up @@ -45,7 +45,7 @@ describe('YouTube samples', () => {
.reply(200, {kind: 'youtube#video'});
const data = await samples.upload.runSample(someFile);
assert(data);
assert.equal(data.kind, 'youtube#video');
assert.strictEqual(data.kind, 'youtube#video');
scope.done();
});
});
9 changes: 5 additions & 4 deletions test/test.apikey.ts
Expand Up @@ -23,28 +23,29 @@ import {Utils} from './utils';
async function testGet(drive: APIEndpoint) {
nock(Utils.baseUrl).get('/drive/v2/files/123?key=APIKEY').reply(200);
const res = await drive.files.get({fileId: '123', auth: 'APIKEY'});
assert.equal(Utils.getQs(res), 'key=APIKEY');
assert.strictEqual(Utils.getQs(res), 'key=APIKEY');
}

async function testParams2(drive: APIEndpoint) {
nock(Utils.baseUrl).get('/drive/v2/files/123?key=API%20KEY').reply(200);
const res = await drive.files.get({fileId: '123', auth: 'API KEY'});
assert.equal(Utils.getQs(res), 'key=API%20KEY');
assert.strictEqual(Utils.getQs(res), 'key=API%20KEY');
}

async function testKeyParam(drive: APIEndpoint) {
nock(Utils.baseUrl).get('/drive/v2/files/123?key=abc123').reply(200);
const res =
await drive.files.get({fileId: '123', auth: 'API KEY', key: 'abc123'});
assert.equal(Utils.getQs(res), 'key=abc123');
assert.strictEqual(Utils.getQs(res), 'key=abc123');
}

async function testAuthKey(urlshortener: APIEndpoint) {
nock(Utils.baseUrl)
.get('/urlshortener/v1/url/history?key=YOUR%20API%20KEY')
.reply(200);
const res = await urlshortener.url.list({auth: 'YOUR API KEY'});
assert.equal(Utils.getQs(res)!.indexOf('key=YOUR%20API%20KEY') > -1, true);
assert.strictEqual(
Utils.getQs(res)!.indexOf('key=YOUR%20API%20KEY') > -1, true);
}

describe('API key', () => {
Expand Down

0 comments on commit c15ffef

Please sign in to comment.