Skip to content

Commit

Permalink
refactor: use explicit mocha imports (#841)
Browse files Browse the repository at this point in the history
* refactor: use explicit mocha imports

* test: more imports

Co-authored-by: Alexander Fenster <[email protected]>
  • Loading branch information
JustinBeckwith and alexander-fenster committed Jan 4, 2020
1 parent f8f7506 commit 6083465
Show file tree
Hide file tree
Showing 24 changed files with 22 additions and 7 deletions.
3 changes: 0 additions & 3 deletions samples/system-test/.eslintrc.yml

This file was deleted.

1 change: 1 addition & 0 deletions samples/system-test/quickstart.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

const {PubSub} = require('@google-cloud/pubsub');
const {assert} = require('chai');
const {describe, it, after} = require('mocha');
const cp = require('child_process');
const uuid = require('uuid');

Expand Down
1 change: 1 addition & 0 deletions samples/system-test/subscriptions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
const {PubSub} = require('@google-cloud/pubsub');
const assertRejects = require('assert').rejects;
const {assert} = require('chai');
const {describe, it, before, after} = require('mocha');
const cp = require('child_process');
const uuid = require('uuid');

Expand Down
1 change: 1 addition & 0 deletions samples/system-test/topics.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

const {PubSub} = require('@google-cloud/pubsub');
const {assert} = require('chai');
const {describe, it, before, after} = require('mocha');
const cp = require('child_process');
const uuid = require('uuid');

Expand Down
2 changes: 0 additions & 2 deletions smoke-test/.eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---
env:
mocha: true
rules:
node/no-missing-require: off
no-console: off
2 changes: 2 additions & 0 deletions smoke-test/publisher_smoke_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

'use strict';

const {describe, it} = require('mocha');

describe('PublisherSmokeTest', () => {
if (!process.env.GCLOUD_PROJECT) {
throw new Error('Usage: GCLOUD_PROJECT=<project_id> node #{$0}');
Expand Down
1 change: 1 addition & 0 deletions system-test/pubsub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// limitations under the License.

import * as assert from 'assert';
import {describe, it} from 'mocha';
import * as crypto from 'crypto';
import defer = require('p-defer');
import * as uuid from 'uuid';
Expand Down
2 changes: 0 additions & 2 deletions test/.eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
---
env:
mocha: true
rules:
node/no-missing-require: off
1 change: 1 addition & 0 deletions test/gapic-v1.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
'use strict';

const assert = require('assert');
const {describe, it} = require('mocha');
const {PassThrough} = require('stream');

const pubsubModule = require('../src');
Expand Down
1 change: 1 addition & 0 deletions test/histogram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// limitations under the License.

import * as assert from 'assert';
import {describe, it} from 'mocha';
import {Histogram} from '../src/histogram.js';

describe('Histogram', () => {
Expand Down
1 change: 1 addition & 0 deletions test/iam.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import * as promisify from '@google-cloud/promisify';
import * as assert from 'assert';
import {describe, it} from 'mocha';
import * as proxyquire from 'proxyquire';

import * as iamTypes from '../src/iam';
Expand Down
1 change: 1 addition & 0 deletions test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// limitations under the License.

import * as assert from 'assert';
import {describe, it} from 'mocha';
import * as pubsub from '../src';

describe('exports', () => {
Expand Down
1 change: 1 addition & 0 deletions test/lease-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

import * as assert from 'assert';
import {describe, it} from 'mocha';
import {EventEmitter} from 'events';
import * as proxyquire from 'proxyquire';
import * as sinon from 'sinon';
Expand Down
1 change: 1 addition & 0 deletions test/message-queues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

import * as assert from 'assert';
import {describe, it} from 'mocha';
import {EventEmitter} from 'events';
import {CallOptions} from 'google-gax';
import {Metadata, ServiceError} from '@grpc/grpc-js';
Expand Down
1 change: 1 addition & 0 deletions test/message-stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

import * as assert from 'assert';
import {describe, it} from 'mocha';
import {Metadata, ServiceError} from '@grpc/grpc-js';
import * as proxyquire from 'proxyquire';
import * as sinon from 'sinon';
Expand Down
1 change: 1 addition & 0 deletions test/publisher/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import * as pfy from '@google-cloud/promisify';
import * as assert from 'assert';
import {describe, it} from 'mocha';
import {EventEmitter} from 'events';
import * as proxyquire from 'proxyquire';
import * as sinon from 'sinon';
Expand Down
1 change: 1 addition & 0 deletions test/publisher/message-batch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

import * as assert from 'assert';
import {describe, it} from 'mocha';
import {randomBytes} from 'crypto';
import * as sinon from 'sinon';

Expand Down
1 change: 1 addition & 0 deletions test/publisher/message-queues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import {ServiceError} from '@grpc/grpc-js';
import * as assert from 'assert';
import {describe, it} from 'mocha';
import {EventEmitter} from 'events';
import * as proxyquire from 'proxyquire';
import * as sinon from 'sinon';
Expand Down
1 change: 1 addition & 0 deletions test/publisher/publish-error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

import * as assert from 'assert';
import {describe, it} from 'mocha';
import {ServiceError, Metadata} from '@grpc/grpc-js';
import {PublishError} from '../../src/publisher/publish-error';

Expand Down
1 change: 1 addition & 0 deletions test/pubsub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import * as pjy from '@google-cloud/projectify';
import * as promisify from '@google-cloud/promisify';
import arrify = require('arrify');
import * as assert from 'assert';
import {describe, it} from 'mocha';
import * as gax from 'google-gax';
import * as grpc from '@grpc/grpc-js';
import {CallOptions, ChannelCredentials, ServiceError} from '@grpc/grpc-js';
Expand Down
1 change: 1 addition & 0 deletions test/snapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import * as pfy from '@google-cloud/promisify';
import * as assert from 'assert';
import {describe, it} from 'mocha';
import * as proxyquire from 'proxyquire';
import * as sinon from 'sinon';

Expand Down
1 change: 1 addition & 0 deletions test/subscriber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

import * as assert from 'assert';
import {describe, it} from 'mocha';
import {EventEmitter} from 'events';
import {common as protobuf} from 'protobufjs';
import * as proxyquire from 'proxyquire';
Expand Down
1 change: 1 addition & 0 deletions test/subscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import * as pfy from '@google-cloud/promisify';
import * as assert from 'assert';
import {describe, it} from 'mocha';
import {EventEmitter} from 'events';
import {ServiceError} from '@grpc/grpc-js';
import * as proxyquire from 'proxyquire';
Expand Down
1 change: 1 addition & 0 deletions test/topic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import * as pfy from '@google-cloud/promisify';
import * as assert from 'assert';
import {describe, it} from 'mocha';
import {CallOptions} from 'google-gax';
import {ServiceError} from '@grpc/grpc-js';
import * as proxyquire from 'proxyquire';
Expand Down

0 comments on commit 6083465

Please sign in to comment.