diff --git a/packages/google-cloud-dns/test/change.ts b/packages/google-cloud-dns/test/change.ts index 717b2dcc696..a3c908c318d 100644 --- a/packages/google-cloud-dns/test/change.ts +++ b/packages/google-cloud-dns/test/change.ts @@ -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; @@ -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; diff --git a/packages/google-cloud-dns/test/index.ts b/packages/google-cloud-dns/test/index.ts index 2993b793c62..a625adc48ac 100644 --- a/packages/google-cloud-dns/test/index.ts +++ b/packages/google-cloud-dns/test/index.ts @@ -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'; @@ -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() {}, }); @@ -68,8 +69,11 @@ const fakePromisify = extend({}, promisify, { }, }); -function FakeZone() { - this.calledWith_ = arguments; +class FakeZone { + calledWith_: IArguments; + constructor() { + this.calledWith_ = arguments; + } } describe('DNS', () => { diff --git a/packages/google-cloud-dns/test/zone.ts b/packages/google-cloud-dns/test/zone.ts index 949568101af..579c8d75e8d 100644 --- a/packages/google-cloud-dns/test/zone.ts +++ b/packages/google-cloud-dns/test/zone.ts @@ -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; } @@ -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', () => { diff --git a/packages/google-cloud-dns/tsconfig.json b/packages/google-cloud-dns/tsconfig.json index 1942ae08fa2..5dc9ad65f2c 100644 --- a/packages/google-cloud-dns/tsconfig.json +++ b/packages/google-cloud-dns/tsconfig.json @@ -3,8 +3,7 @@ "compilerOptions": { "rootDir": ".", "outDir": "build", - "noImplicitAny": false, - "noImplicitThis": false + "noImplicitAny": false }, "include": [ "src/*.ts",