Skip to content

Commit

Permalink
test: restore Function#length property in wrapped mocha test function…
Browse files Browse the repository at this point in the history
…s when using continuation-local-storage with node 8 (googleapis#553)

PR-URL: googleapis#553
  • Loading branch information
kjin authored Sep 10, 2017
1 parent e744614 commit 6f9614a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion test/plugins/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var semver = require('semver');
var logger = require('@google-cloud/common').logger;
var trace = require('../..');
var cls = require('../../src/cls.js');
if (semver.satisfies(process.version, '>=8')) {
if (semver.satisfies(process.version, '>=8') && process.env.GCLOUD_TRACE_NEW_CONTEXT) {
// Monkeypatch the monkeypatcher
var oldIt = global.it;
global.it = function it(title, fn) {
Expand Down
4 changes: 1 addition & 3 deletions test/test-cls-ah.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@ var assert = require('assert');
var http = require('http');
var semver = require('semver');

if (semver.satisfies(process.version, '<8')) {
if (semver.satisfies(process.version, '<8') || !process.env.GCLOUD_TRACE_NEW_CONTEXT) {
console.log('Skipping cls-ah tests on node version without async hooks');
return;
} else {
assert.ok(process.env.GCLOUD_TRACE_NEW_CONTEXT);
}

var cls = require('../src/cls-ah.js');
Expand Down

0 comments on commit 6f9614a

Please sign in to comment.