mirror of
https://github.com/status-im/realm-js.git
synced 2025-01-11 06:46:03 +00:00
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');
|
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) {
|
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:
|
// A Node 6 regression in v8 causes an error when converting our objects to strings:
|
||||||
// TypeError: Cannot convert a Symbol value to a string
|
// 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');
|
TestCase.assertEqual(list.join(' '), 'Ari Tim Bjarne');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user