Skip to content

Commit

Permalink
fix(types): assert in typescript 3.7 (#1198)
Browse files Browse the repository at this point in the history
* fix(types): assert in typescript 3.7

* npm run fix
  • Loading branch information
jkwlui authored May 20, 2020
1 parent 621e6f4 commit d5aa8b7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
6 changes: 4 additions & 2 deletions test/bucket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,9 @@ describe('Bucket', () => {
});

const bucket = new Bucket(storageInstance, BUCKET_NAME);
assert(bucket instanceof ServiceObject);
// Using assert.strictEqual instead of assert to prevent
// coercing of types.
assert.strictEqual(bucket instanceof ServiceObject, true);

const calledWith = bucket.calledWith_[0];

Expand Down Expand Up @@ -2069,8 +2071,8 @@ describe('Bucket', () => {
FakeServiceObject.prototype.request = ((
reqOpts: DecorateRequestOptions
) => {
assert.strictEqual(reqOpts.qs, options.qs);
assert.strictEqual(reqOpts.qs.userProject, USER_PROJECT);
assert.strictEqual(reqOpts.qs, options.qs);
done();
// eslint-disable-next-line @typescript-eslint/no-explicit-any
}) as any;
Expand Down
4 changes: 3 additions & 1 deletion test/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ describe('Channel', () => {

describe('initialization', () => {
it('should inherit from ServiceObject', () => {
assert(channel instanceof ServiceObject);
// Using assert.strictEqual instead of assert to prevent
// coercing of types.
assert.strictEqual(channel instanceof ServiceObject, true);

const calledWith = channel.calledWith_[0];

Expand Down
4 changes: 3 additions & 1 deletion test/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,9 @@ describe('File', () => {
});

it('should inherit from ServiceObject', () => {
assert(file instanceof ServiceObject);
// Using assert.strictEqual instead of assert to prevent
// coercing of types.
assert.strictEqual(file instanceof ServiceObject, true);

const calledWith = file.calledWith_[0];

Expand Down
4 changes: 3 additions & 1 deletion test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ describe('Storage', () => {
});

it('should inherit from Service', () => {
assert(storage instanceof Service);
// Using assert.strictEqual instead of assert to prevent
// coercing of types.
assert.strictEqual(storage instanceof Service, true);

const calledWith = storage.calledWith_[0];

Expand Down

0 comments on commit d5aa8b7

Please sign in to comment.