|
@@ -1,6 +1,8 @@
|
|
|
// Copyright (c) Jupyter Development Team.
|
|
|
// Distributed under the terms of the Modified BSD License.
|
|
|
|
|
|
+import encoding from 'text-encoding';
|
|
|
+
|
|
|
// Utils from: https://github.com/jupyterlab/jupyterlab/blob/b1e2b83047421bf7196bec5f2a94d0616dcb2329/packages/services/test/utils.ts
|
|
|
|
|
|
import { ServerConnection } from '@jupyterlab/services';
|
|
@@ -34,6 +36,22 @@ export const KERNELSPECS: JSONObject = {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+// stub for node global
|
|
|
+declare let global: any;
|
|
|
+
|
|
|
+/**
|
|
|
+ * This can be used by test modules that wouldn't otherwise import
|
|
|
+ * this file.
|
|
|
+ */
|
|
|
+export function init(): void {
|
|
|
+ if (typeof global !== 'undefined') {
|
|
|
+ global.TextEncoder = encoding.TextEncoder;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// Call init.
|
|
|
+init();
|
|
|
+
|
|
|
/**
|
|
|
* Create new server connection settings.
|
|
|
*
|