Skip to content

Commit

Permalink
test: add new abstraction for fixtures testing
Browse files Browse the repository at this point in the history
  • Loading branch information
kjin committed Nov 16, 2018
1 parent 872866b commit f1b4c00
Show file tree
Hide file tree
Showing 5 changed files with 491 additions and 505 deletions.
5 changes: 3 additions & 2 deletions scripts/check-install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ export async function checkInstall() {
});
// Install the tgz file as a package, along with necessities.
// @types/node version should match the current process version, but clamped
// at >=9 (because of http2 types).
const nodeTypesVersion = Math.max(getNodeMajorVersion(), 9);
// at >=9 (because of http2 types) and <11 (because Node 11 doesn't yet have
// type definitions).
const nodeTypesVersion = Math.min(Math.max(getNodeMajorVersion(), 9), 10);
await spawnP('npm', ['install', 'typescript', `@types/node@${nodeTypesVersion}`, tgz[0]], {
cwd: installDir
});
Expand Down
5 changes: 3 additions & 2 deletions test/plugins/test-trace-google-gax.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import * as assert from 'assert';

import * as testTraceModule from '../trace';
import {describeInterop} from '../utils';

interface ApiCallSettings {
merge: () => {
Expand All @@ -55,14 +56,14 @@ type GaxModule = {
OuterApiCall<I, O>;
};

describe('Tracing with google-gax', () => {
describeInterop<GaxModule>('google-gax', fixture => {
let googleGax: GaxModule;

before(() => {
testTraceModule.setCLSForTest();
testTraceModule.setPluginLoaderForTest();
testTraceModule.start();
googleGax = require('./fixtures/google-gax0.16');
googleGax = fixture.require();
});

after(() => {
Expand Down
Loading

0 comments on commit f1b4c00

Please sign in to comment.