mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 11:35:40 +01:00
Restore basic-languages unit tests
This commit is contained in:
parent
0f7286cf55
commit
219b9b25eb
3 changed files with 8 additions and 10 deletions
57
test/unit/all.js
Normal file
57
test/unit/all.js
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
const requirejs = require('requirejs');
|
||||
const jsdom = require('jsdom');
|
||||
const glob = require('glob');
|
||||
const path = require('path');
|
||||
|
||||
requirejs.config({
|
||||
baseUrl: '',
|
||||
paths: {
|
||||
'vs/fillers/monaco-editor-core': 'out/amd/fillers/monaco-editor-core-amd',
|
||||
'vs/basic-languages': 'out/amd/basic-languages',
|
||||
vs: './node_modules/monaco-editor-core/dev/vs'
|
||||
},
|
||||
nodeRequire: require
|
||||
});
|
||||
|
||||
const tmp = new jsdom.JSDOM('<!DOCTYPE html><html><body></body></html>');
|
||||
global.AMD = true;
|
||||
global.document = tmp.window.document;
|
||||
global.navigator = tmp.window.navigator;
|
||||
global.self = global;
|
||||
global.document.queryCommandSupported = function () {
|
||||
return false;
|
||||
};
|
||||
global.window = {
|
||||
location: {},
|
||||
navigator: tmp.window.navigator,
|
||||
matchMedia: function () {
|
||||
return {
|
||||
matches: false,
|
||||
addListener: function () {}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
requirejs(
|
||||
['test/unit/setup'],
|
||||
function () {
|
||||
glob('out/amd/basic-languages/*/*.test.js', { cwd: path.join(__dirname, '../../') }, function (err, files) {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
return;
|
||||
}
|
||||
requirejs(
|
||||
files.map((f) => f.replace(/^out\/amd/, 'vs').replace(/\.js$/, '')),
|
||||
function () {
|
||||
// We can launch the tests!
|
||||
},
|
||||
function (err) {
|
||||
console.log(err);
|
||||
}
|
||||
);
|
||||
});
|
||||
},
|
||||
function (err) {
|
||||
console.log(err);
|
||||
}
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue