mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 20:13:32 +01:00
Try to restore yarn mocha and move browser tests to /browser/
This commit is contained in:
@@ -10,9 +10,8 @@ const assert = require('assert');
|
||||
const path = require('path');
|
||||
const glob = require('glob');
|
||||
const jsdom = require('jsdom-no-contextify');
|
||||
const TEST_GLOB = '**/test/**/*.test.js';
|
||||
const minimatch = require('minimatch');
|
||||
const coverage = require('../coverage');
|
||||
|
||||
const optimist = require('optimist')
|
||||
.usage('Run the Code tests. All mocha options apply.')
|
||||
.describe('build', 'Run from out-build').boolean('build')
|
||||
@@ -22,6 +21,9 @@ const optimist = require('optimist')
|
||||
.alias('h', 'help').boolean('h')
|
||||
.describe('h', 'Show help');
|
||||
|
||||
const TEST_GLOB = '**/test/**/*.test.js';
|
||||
const excludeGlob = '**/{browser,electron-sandbox,electron-browser,electron-main,editor/contrib}/**/*.test.js';
|
||||
|
||||
const argv = optimist.argv;
|
||||
|
||||
if (argv.help) {
|
||||
@@ -112,10 +114,13 @@ function main() {
|
||||
} else {
|
||||
loadFunc = (cb) => {
|
||||
glob(TEST_GLOB, { cwd: src }, function (err, files) {
|
||||
const modulesToLoad = files.map(function (file) {
|
||||
return file.replace(/\.js$/, '');
|
||||
});
|
||||
define(modulesToLoad, function () { cb(null); }, cb);
|
||||
const modules = [];
|
||||
for (let file of files) {
|
||||
if (!minimatch(file, excludeGlob)) {
|
||||
modules.push(file.replace(/\.js$/, ''));
|
||||
}
|
||||
}
|
||||
define(modules, function () { cb(null); }, cb);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user