Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

build!: update to latest version of gts and typescript #433

Merged
merged 10 commits into from
Apr 15, 2020
15 changes: 0 additions & 15 deletions .eslintrc.yml

This file was deleted.

3 changes: 1 addition & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
**/node_modules
**/coverage
test/fixtures
**/.coverage
build/
docs/
protos/
8 changes: 0 additions & 8 deletions .prettierrc

This file was deleted.

10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,16 @@
"devDependencies": {
"codecov": "^3.0.2",
"concat-stream": "^2.0.0",
"eslint": "^6.0.0",
"eslint-config-prettier": "^6.0.0",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-prettier": "^3.0.0",
"gts": "^2.0.0",
"jsdoc": "^3.6.2",
"jsdoc-fresh": "^1.0.1",
"jsdoc-region-tag": "^1.0.2",
"linkinator": "^2.0.0",
"mocha": "^7.0.0",
"mocha": "^7.1.1",
"c8": "^7.0.0",
"prettier": "^1.13.5",
"proxyquire": "^2.0.1",
"uuid": "^7.0.0"
"uuid": "^7.0.0",
"typescript": "^3.8.3"
}
}
4 changes: 2 additions & 2 deletions samples/deleteVM.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2017, Google, Inc.
// Copyright 2020, Google, Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
Expand Down Expand Up @@ -31,7 +31,7 @@ async function main(
const vm = zone.vm(name);
const [operation] = await vm.delete();
await operation.promise();
console.log(`VM deleted!`);
console.log('VM deleted!');
}
deleteVM();
// [END gce_delete_vm]
Expand Down
3 changes: 2 additions & 1 deletion samples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"author": "Google Inc.",
"repository": "googleapis/nodejs-compute",
"files": [
"*.js"
"*.js",
"!test/"
],
"engines": {
"node": ">=8"
Expand Down
28 changes: 14 additions & 14 deletions samples/test/mailjet.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,41 +14,41 @@

'use strict';

const proxyquire = require(`proxyquire`).noPreserveCache();
const proxyquire = require('proxyquire').noPreserveCache();
const assert = require('assert');

process.env.MAILJET_API_KEY = `foo`;
process.env.MAILJET_API_SECRET = `bar`;
process.env.MAILJET_API_KEY = 'foo';
process.env.MAILJET_API_SECRET = 'bar';

describe('mailjet', () => {
it('should send an email', () => {
proxyquire(`../mailjet`, {
proxyquire('../mailjet', {
nodemailer: {
createTransport: arg => {
assert.strictEqual(arg, `test`);
assert.strictEqual(arg, 'test');
return {
sendMail: payload => {
assert.deepStrictEqual(payload, {
from: `ANOTHER_EMAIL@ANOTHER_EXAMPLE.COM`,
to: `EMAIL@EXAMPLE.COM`,
subject: `test email from Node.js on Google Cloud Platform`,
text: `Hello!\n\nThis a test email from Node.js.`,
from: 'ANOTHER_EMAIL@ANOTHER_EXAMPLE.COM',
to: 'EMAIL@EXAMPLE.COM',
subject: 'test email from Node.js on Google Cloud Platform',
text: 'Hello!\n\nThis a test email from Node.js.',
});
return `done`;
return 'done';
},
};
},
},
'nodemailer-smtp-transport': options => {
assert.deepStrictEqual(options, {
host: `in.mailjet.com`,
host: 'in.mailjet.com',
port: 2525,
auth: {
user: `foo`,
pass: `bar`,
user: 'foo',
pass: 'bar',
},
});
return `test`;
return 'test';
},
});
});
Expand Down
6 changes: 3 additions & 3 deletions samples/test/sendgrid.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
const proxyquire = require('proxyquire');
const {assert} = require('chai');

process.env.SENDGRID_API_KEY = `foo`;
process.env.SENDGRID_API_KEY = 'foo';

describe('sendgrid', () => {
it('should send an email', () => {
proxyquire(`../sendgrid`, {
proxyquire('../sendgrid', {
'@sendgrid/mail': {
setApiKey: key => {
assert.strictEqual(key, `foo`);
assert.strictEqual(key, 'foo');
},
send: msg => {
assert.deepStrictEqual(msg, {
Expand Down
2 changes: 1 addition & 1 deletion src/address.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ class Address extends common.ServiceObject {
method: 'DELETE',
uri: '',
},
function(err, resp) {
(err, resp) => {
if (err) {
callback(err, null, resp);
return;
Expand Down
4 changes: 2 additions & 2 deletions src/autoscaler.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ class Autoscaler extends common.ServiceObject {
delete(callback) {
callback = callback || common.util.noop;
const zone = this.zone;
super.delete(function(err, resp) {
super.delete((err, resp) => {
if (err) {
callback(err, null, resp);
return;
Expand Down Expand Up @@ -285,7 +285,7 @@ class Autoscaler extends common.ServiceObject {
},
json: metadata,
},
function(err, resp) {
(err, resp) => {
if (err) {
callback(err, null, resp);
return;
Expand Down
4 changes: 2 additions & 2 deletions src/disk.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ class Disk extends common.ServiceObject {
name: name,
}),
},
function(err, resp) {
(err, resp) => {
if (err) {
callback(err, null, null, resp);
return;
Expand Down Expand Up @@ -293,7 +293,7 @@ class Disk extends common.ServiceObject {
delete(callback) {
const zone = this.zone;
callback = callback || common.util.noop;
super.delete(function(err, resp) {
super.delete((err, resp) => {
if (err) {
callback(err, null, resp);
return;
Expand Down
4 changes: 2 additions & 2 deletions src/firewall.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ class Firewall extends common.ServiceObject {
delete(callback) {
const compute = this.compute;
callback = callback || common.util.noop;
super.delete(function(err, resp) {
super.delete((err, resp) => {
if (err) {
callback(err, null, resp);
return;
Expand Down Expand Up @@ -273,7 +273,7 @@ class Firewall extends common.ServiceObject {
uri: '',
json: metadata,
},
function(err, resp) {
(err, resp) => {
if (err) {
callback(err, null, resp);
return;
Expand Down
4 changes: 2 additions & 2 deletions src/health-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ class HealthCheck extends common.ServiceObject {
delete(callback) {
const compute = this.compute;
callback = callback || common.util.noop;
super.delete(function(err, resp) {
super.delete((err, resp) => {
if (err) {
callback(err, null, resp);
return;
Expand Down Expand Up @@ -273,7 +273,7 @@ class HealthCheck extends common.ServiceObject {
setMetadata(metadata, callback) {
const compute = this.compute;
callback = callback || common.util.noop;
super.setMetadata(metadata, function(err, resp) {
super.setMetadata(metadata, (err, resp) => {
if (err) {
callback(err, null, resp);
return;
Expand Down
2 changes: 1 addition & 1 deletion src/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ class Image extends common.ServiceObject {
delete(callback) {
const compute = this.parent;
callback = callback || common.util.noop;
super.delete(function(err, resp) {
super.delete((err, resp) => {
if (err) {
callback(err, null, resp);
return;
Expand Down
Loading