mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 11:35:40 +01:00
Bring smoketest scripts together (#3370)
This commit is contained in:
parent
5d653b2569
commit
2b3d8516c6
15 changed files with 1546 additions and 112 deletions
|
|
@ -9,10 +9,14 @@ const yaserver = require('yaserver');
|
|||
const http = require('http');
|
||||
const cp = require('child_process');
|
||||
const path = require('path');
|
||||
const { PORT } = require('./common');
|
||||
const DEBUG_TESTS = process.argv.includes('--debug-tests');
|
||||
|
||||
/** @typedef {import('./common').BrowserKind} BrowserKind */
|
||||
/** @typedef {import('./common').PackagerKind} PackagerKind */
|
||||
/** @typedef {import('./common').TestInfo} TestInfo */
|
||||
|
||||
const DEBUG_TESTS = process.argv.includes('--debug-tests');
|
||||
const REPO_ROOT = path.join(__dirname, '../../');
|
||||
const PORT = 8563;
|
||||
|
||||
yaserver
|
||||
.createServer({
|
||||
|
|
@ -37,7 +41,7 @@ yaserver
|
|||
async function runTests() {
|
||||
// uncomment to shortcircuit and run a specific combo
|
||||
// await runTest('webpack', 'chromium'); return;
|
||||
/** @type {('amd'|'webpack'|'esbuild'|'vite')[]} */
|
||||
/** @type {PackagerKind[]} */
|
||||
const testTypes = ['amd', 'webpack', 'esbuild', 'vite'];
|
||||
|
||||
for (const type of testTypes) {
|
||||
|
|
@ -48,16 +52,20 @@ async function runTests() {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param {'amd'|'webpack'|'esbuild'|'vite'} type
|
||||
* @param {'chromium'|'firefox'|'webkit'} browser
|
||||
* @param {PackagerKind} packager
|
||||
* @param {BrowserKind} browser
|
||||
* @returns
|
||||
*/
|
||||
function runTest(type, browser) {
|
||||
function runTest(packager, browser) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const env = { BROWSER: browser, TESTS_TYPE: type, ...process.env };
|
||||
if (DEBUG_TESTS) {
|
||||
env['DEBUG_TESTS'] = 'true';
|
||||
}
|
||||
/** @type TestInfo */
|
||||
const testInfo = {
|
||||
browser,
|
||||
packager,
|
||||
debugTests: DEBUG_TESTS,
|
||||
port: PORT
|
||||
};
|
||||
const env = { MONACO_TEST_INFO: JSON.stringify(testInfo), ...process.env };
|
||||
const proc = cp.spawn(
|
||||
'node',
|
||||
[
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue