From 67c4f1e1a3c32870f72bb9140069eced263b6901 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Fri, 24 Mar 2017 12:04:25 +0100 Subject: [PATCH] Fix browser tests on Node.js 0.10 --- test/helpers/browser.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/helpers/browser.js b/test/helpers/browser.js index 8b6f03d..5580e0f 100644 --- a/test/helpers/browser.js +++ b/test/helpers/browser.js @@ -63,6 +63,12 @@ function createContext() { // `window` is used by loopback to detect browser runtime context.window = context; + // In Node.js 0.10, the Uint8Array is provided by Node.js glue, + // it's not available in the V8 runtime itself + if (/^v0\.10/.test(process.version)) { + context.Uint8Array = Uint8Array; + } + return vm.createContext(context); } exports.createContext = createContext;