Код: Выделить всё
Error: Path file:///Users/kurmasz/Documents/LocalResearch/QLC/gvQLC/test/suite/index does not point to a valid extension test runner.
Код: Выделить всё
const path = require('path')
const Mocha = require('mocha')
const glob = require('glob')
console.log('********************* Here!')
module.exports = function run() {
// Create the mocha test
const mocha = new Mocha({
ui: 'tdd'
});
const testsRoot = path.resolve(__dirname, '..');
console.log(`********************** Test Root: ${testsRoot}`)
return new Promise((c, e) => {
glob('**/**.test.js', { cwd: testsRoot }, (err, files) => {
if (err) {
return e(err);
}
// Add files to the test suite
files.forEach(f => mocha.addFile(path.resolve(testsRoot, f)));
try {
// Run the mocha test
mocha.run(failures => {
if (failures > 0) {
e(new Error(`${failures} tests failed.`));
} else {
c();
}
});
} catch (err) {
console.error(err);
e(err);
}
});
});
}
console.log('********************* Done!')
< /code>
Обе консоль < /code> Печать печати, поэтому код работает и не бросает ошибку. < /p>
Я использую
vs code 1.101.0
@vscode /test-electron 2.5.2
mocha 11.6 < /p>
Я также вижу, когда я работаю.✔ Validated version: 1.101.1
✔ Found existing install in /Users/.../.vscode-test/vscode-darwin-1.101.1
Подробнее здесь: https://stackoverflow.com/questions/796 ... javascript