Skip to content

Commit

Permalink
refactor: use explicit mocha imports (#1175)
Browse files Browse the repository at this point in the history
Co-authored-by: Kelvin Jin <[email protected]>
  • Loading branch information
2 people authored and bcoe committed Jan 2, 2020
1 parent 21dbb0d commit a6f825e
Show file tree
Hide file tree
Showing 32 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions system-test/trace-express.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const tracer = require('../').start({
require('hard-rejection')();

const assert = require('assert');
const {describe, it} = require('mocha');
const googleAuth = require('google-auto-auth');
const got = require('got');
const queryString = require('querystring');
Expand Down
1 change: 1 addition & 0 deletions test/plugins/test-cls-bluebird.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 {bluebird_3 as BluebirdPromise} from '../../src/plugins/types';
import {Trace} from '../../src/trace';
Expand Down
1 change: 1 addition & 0 deletions test/plugins/test-trace-google-gax.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
*/

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

import * as testTraceModule from '../trace';
import {describeInterop} from '../utils';
Expand Down
1 change: 1 addition & 0 deletions test/plugins/test-trace-grpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { TraceLabels } from '../../src/trace-labels';
import * as TracingPolicy from '../../src/tracing-policy';
import * as util from '../../src/util';
import * as assert from 'assert';
import {describe, it} from 'mocha';
import { asRootSpanData, describeInterop, DEFAULT_SPAN_DURATION, assertSpanDuration } from '../utils';
import { Span } from '../../src/plugin-types';
import { FORCE_NEW } from '../../src/util';
Expand Down
1 change: 1 addition & 0 deletions test/plugins/test-trace-http.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 {EventEmitter} from 'events';
import * as httpModule from 'http';
import * as httpsModule from 'https';
Expand Down
1 change: 1 addition & 0 deletions test/plugins/test-trace-http2.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';
// This is imported only for types. Generated .js file should NOT load 'http2'
// in this place. It is dynamically loaded later from each test suite below.
import * as http2Types from 'http2';
Expand Down
1 change: 1 addition & 0 deletions test/plugins/test-trace-knex.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 knexTypes from 'knex';

import {Tracer} from '../../src/plugin-types';
Expand Down
1 change: 1 addition & 0 deletions test/plugins/test-trace-mongoose-async-await.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 mongooseTypes from 'mongoose';

import * as traceTestModule from '../trace';
Expand Down
1 change: 1 addition & 0 deletions test/plugins/test-trace-node-fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import * as fetchTypes from 'node-fetch'; // For types only.
import * as testTraceModule from '../trace';
import * as assert from 'assert';
import {describe, it} from 'mocha';
import {describeInterop} from '../utils';
import {Express4} from '../web-frameworks/express';
import {Express4Secure} from '../web-frameworks/express-secure';
Expand Down
1 change: 1 addition & 0 deletions test/test-agent-stopped.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 http from 'http';
import * as traceTestModule from './trace';
import { pluginLoader, PluginLoaderState } from '../src/trace-plugin-loader';
Expand Down
1 change: 1 addition & 0 deletions test/test-cls-ah.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 asyncHooksModule from 'async_hooks';
import * as semver from 'semver';

Expand Down
1 change: 1 addition & 0 deletions test/test-cls.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 {EventEmitter} from 'events';
import * as semver from 'semver';
import {inspect} from 'util';
Expand Down
1 change: 1 addition & 0 deletions test/test-config-plugins.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 {defaultConfig} from '../src/config';
import {StackdriverTracerComponents} from '../src/trace-api';
Expand Down
1 change: 1 addition & 0 deletions test/test-config-priority.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 path from 'path';

import {Trace} from '../src/trace';
Expand Down
1 change: 1 addition & 0 deletions test/test-config.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 semver from 'semver';
import * as util from 'util';

Expand Down
1 change: 1 addition & 0 deletions test/test-default-ignore-ah-health.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 trace from './trace';

Expand Down
1 change: 1 addition & 0 deletions test/test-env-log-level.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 shimmer from 'shimmer';

import * as logger from '../src/logger';
Expand Down
1 change: 1 addition & 0 deletions test/test-modules-loaded-before-agent.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 shimmer from 'shimmer';

import * as log from '../src/logger';
Expand Down
1 change: 1 addition & 0 deletions test/test-plugin-loader.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 path from 'path';

import {OpenCensusPropagation} from '../src/config';
Expand Down
1 change: 1 addition & 0 deletions test/test-preloaded-agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import * as semver from 'semver';
import { execSync } from 'child_process';
import * as assert from 'assert';
import {describe, it} from 'mocha';

describe('preloaded agent', () => {
it('should start automatically when preloaded using --require', () => {
Expand Down
1 change: 1 addition & 0 deletions test/test-span-data.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 {Constants, SpanType} from '../src/constants';
import {BaseSpanData, ChildSpanData, RootSpanData} from '../src/span-data';
Expand Down
1 change: 1 addition & 0 deletions test/test-trace-api-none-cls.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 {SpanType} from '../src/constants';
import {Tracer} from '../src/plugin-types';
Expand Down
1 change: 1 addition & 0 deletions test/test-trace-api.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 {cls, TraceCLS, TraceCLSMechanism} from '../src/cls';
import {
Expand Down
1 change: 1 addition & 0 deletions test/test-trace-cluster.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 axiosModule from 'axios';
import * as cluster from 'cluster';
import {Server} from 'http';
Expand Down
1 change: 1 addition & 0 deletions test/test-trace-hapi-tails.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 axiosModule from 'axios';
import * as semver from 'semver';

Expand Down
1 change: 1 addition & 0 deletions test/test-trace-policy.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 {RequestDetails} from '../src/config';
import {
Expand Down
1 change: 1 addition & 0 deletions test/test-trace-uncaught-exception.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 {Logger} from '../src/logger';
import {Trace} from '../src/trace';
Expand Down
1 change: 1 addition & 0 deletions test/test-trace-web-frameworks.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 axiosModule from 'axios';
import * as semver from 'semver';

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

import {Service, DecorateRequestOptions} from '@google-cloud/common';
import * as assert from 'assert';
import {describe, it} from 'mocha';
import {GoogleAuth} from 'google-auth-library';
import {JWTInput} from 'google-auth-library/build/src/auth/credentials';
import {RefreshOptions} from 'google-auth-library/build/src/auth/oauth2client';
Expand Down
1 change: 1 addition & 0 deletions test/test-util.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 {inspect} from 'util';

import {Constants} from '../src/constants';
Expand Down
1 change: 1 addition & 0 deletions test/trace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
*/

import * as assert from 'assert';
import {describe, it} from 'mocha';
import * as shimmer from 'shimmer';

import * as trace from '../src';
Expand Down
1 change: 1 addition & 0 deletions test/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
// TODO(kjin): This file should supercede plugins/common.ts.

import * as assert from 'assert';
import {describe, it} from 'mocha';
import * as fs from 'fs';
import * as semver from 'semver';

Expand Down

0 comments on commit a6f825e

Please sign in to comment.