Abstracted check for Node v6
This commit is contained in:
parent
4a5ac413cc
commit
4300e865c7
|
@ -109,6 +109,14 @@ module.exports = {
|
|||
throw new TestFailureError(errorMessage || 'Condition expected to be true');
|
||||
}
|
||||
},
|
||||
|
||||
isNode: function() {
|
||||
return typeof process == 'object' && Object.prototype.toString.call(process) == '[object process]';
|
||||
},
|
||||
|
||||
isNode6: function() {
|
||||
return this.isNode() && process.version.indexOf('v6.') == 0;
|
||||
},
|
||||
};
|
||||
|
||||
function TestFailureError(message) {
|
||||
|
|
|
@ -556,7 +556,7 @@ module.exports = BaseTest.extend({
|
|||
|
||||
// A Node 6 regression in v8 causes an error when converting our objects to strings:
|
||||
// TypeError: Cannot convert a Symbol value to a string
|
||||
if (typeof process != 'object' || ('' + process.version).indexOf('v6.') < 0) {
|
||||
if (!TestCase.isNode6()) {
|
||||
TestCase.assertEqual(list.join(' '), 'Ari Tim Bjarne');
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue