Move more files to test/unit

This commit is contained in:
Alex Dima 2020-02-07 12:21:30 +01:00
parent 4afd61c29f
commit 2e7c169024
No known key found for this signature in database
GPG key ID: 6E58D7B045760DA0
4 changed files with 8 additions and 4 deletions

View file

@ -26,6 +26,10 @@ You can run tests inside a browser instance too:
node test\unit\browser\index.js
## Run (with node)
yarn run mocha --run src/vs/editor/test/browser/controller/cursor.test.ts
## Debug
To debug tests use `--debug` when running the test script. Also, the set of tests can be reduced with the `--run` and `--runGlob` flags. Both require a file path/pattern. Like so:

View file

@ -166,7 +166,7 @@ function main() {
}
if (process.argv.some(function (a) { return /^--browser/.test(a); })) {
require('../../browser');
require('./browser');
} else {
main();
}

View file

@ -9,7 +9,7 @@ const glob = require('glob');
const path = require('path');
const fs = require('fs');
const REPO_ROOT = path.join(__dirname, '../');
const REPO_ROOT = path.join(__dirname, '../../../');
const PORT = 8887;
function template(str, env) {
@ -25,13 +25,13 @@ yaserver.createServer({ rootDir: REPO_ROOT }).then((staticServer) => {
cwd: path.join(REPO_ROOT, 'out'),
// ignore: ['**/test/{node,electron*}/**/*.js']
}, function (err, files) {
if (err) { return res.sendStatus(500); }
if (err) { console.log(err); process.exit(0); }
var modules = files
.map(function (file) { return file.replace(/\.js$/, ''); });
fs.readFile(path.join(__dirname, 'index.html'), 'utf8', function (err, templateString) {
if (err) { return res.sendStatus(500); }
if (err) { console.log(err); process.exit(0); }
res.end(template(templateString, {
modules: JSON.stringify(modules)