Skip to content

Commit

Permalink
Enable noImplicitThis (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeckwith authored Sep 9, 2018
1 parent 1783a04 commit f43056b
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 27 deletions.
13 changes: 7 additions & 6 deletions packages/google-cloud-dns/test/change.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import * as assert from 'assert';
import * as extend from 'extend';
import * as nodeutil from 'util';
import * as proxyquire from 'proxyquire';
import {ServiceObject} from '@google-cloud/common';
import {ServiceObject, ServiceObjectConfig} from '@google-cloud/common';
import * as promisify from '@google-cloud/promisify';

let promisified = false;
Expand All @@ -33,13 +33,14 @@ const fakePromisify = extend({}, promisify, {
},
});

function FakeServiceObject() {
this.calledWith_ = arguments;
ServiceObject.apply(this, arguments);
class FakeServiceObject extends ServiceObject {
calledWith_: IArguments;
constructor(config: ServiceObjectConfig) {
super(config);
this.calledWith_ = arguments;
}
}

nodeutil.inherits(FakeServiceObject, ServiceObject);

describe('Change', () => {
// tslint:disable-next-line:variable-name
let Change;
Expand Down
20 changes: 12 additions & 8 deletions packages/google-cloud-dns/test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import * as assert from 'assert';
import * as extend from 'extend';
import * as nodeutil from 'util';
import * as proxyquire from 'proxyquire';
import {Service} from '@google-cloud/common';
import {Service, ServiceConfig, ServiceOptions} from '@google-cloud/common';
import {util} from '@google-cloud/common';
import * as promisify from '@google-cloud/promisify';

Expand All @@ -44,13 +44,14 @@ const fakePaginator = {
},
};

function FakeService() {
this.calledWith_ = arguments;
Service.apply(this, arguments);
class FakeService extends Service {
calledWith_: IArguments;
constructor(config: ServiceConfig, options?: ServiceOptions) {
super(config, options);
this.calledWith_ = arguments;
}
}

nodeutil.inherits(FakeService, Service);

const fakeUtil = extend({}, util, {
makeAuthenticatedRequestFactory() {},
});
Expand All @@ -68,8 +69,11 @@ const fakePromisify = extend({}, promisify, {
},
});

function FakeZone() {
this.calledWith_ = arguments;
class FakeZone {
calledWith_: IArguments;
constructor() {
this.calledWith_ = arguments;
}
}

describe('DNS', () => {
Expand Down
17 changes: 6 additions & 11 deletions packages/google-cloud-dns/test/zone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,15 @@ const fakeFs = {
},
};

function FakeChange() {
this.calledWith_ = arguments;
class FakeChange {
calledWith_: IArguments;
constructor() {
this.calledWith_ = arguments;
}
}

class FakeRecord {
calledWith_;
calledWith_: IArguments;
constructor() {
this.calledWith_ = arguments;
}
Expand Down Expand Up @@ -357,14 +360,6 @@ describe('Zone', () => {
zone.delete({force: true}, assert.ifError);
});
});

it.skip('should make the correct API request', done => {
FakeServiceObject.prototype.delete = callback => {
assert.strictEqual(this, zone);
callback!(null);
};
zone.delete(done);
});
});

describe('deleteRecords', () => {
Expand Down
3 changes: 1 addition & 2 deletions packages/google-cloud-dns/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
"compilerOptions": {
"rootDir": ".",
"outDir": "build",
"noImplicitAny": false,
"noImplicitThis": false
"noImplicitAny": false
},
"include": [
"src/*.ts",
Expand Down

0 comments on commit f43056b

Please sign in to comment.