forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathunittests.ts
More file actions
40 lines (33 loc) · 1.27 KB
/
unittests.ts
File metadata and controls
40 lines (33 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
'use strict';
// tslint:disable:no-any no-require-imports no-var-requires
if ((Reflect as any).metadata === undefined) {
require('reflect-metadata');
}
process.env.VSC_PYTHON_CI_TEST = '1';
process.env.VSC_PYTHON_UNIT_TEST = '1';
import { setUpDomEnvironment } from './datascience/reactHelpers';
import { initialize } from './vscode-mock';
// Custom module loader so we skip .css files that break non webpack wrapped compiles
// tslint:disable-next-line:no-var-requires no-require-imports
const Module = require('module');
// Required for DS functional tests.
// tslint:disable-next-line:no-function-expression
(function () {
const origRequire = Module.prototype.require;
const _require = (context, filepath) => {
return origRequire.call(context, filepath);
};
Module.prototype.require = function (filepath) {
if (filepath.endsWith('.css')) {
return '';
}
// tslint:disable-next-line:no-invalid-this
return _require(this, filepath);
};
})();
// nteract/transforms-full expects to run in the browser so we have to fake
// parts of the browser here.
setUpDomEnvironment();
initialize();