Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: use strictEqual in tests #1246

Merged
merged 2 commits into from Jul 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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