mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 12:45:39 +01:00
Fixes CI
Some checks failed
CI / CI (push) Has been cancelled
Some checks failed
CI / CI (push) Has been cancelled
This commit is contained in:
parent
d4bb0a8224
commit
93a0a2df32
2 changed files with 14 additions and 7 deletions
|
|
@ -8,6 +8,7 @@
|
||||||
<script src="../../../out/monaco-editor/dev/vs/loader.js"></script>
|
<script src="../../../out/monaco-editor/dev/vs/loader.js"></script>
|
||||||
<script>
|
<script>
|
||||||
require.config({
|
require.config({
|
||||||
|
baseUrl: new URL('..', document.baseURI).toString(),
|
||||||
paths: {
|
paths: {
|
||||||
vs: '../../../out/monaco-editor/dev/vs'
|
vs: '../../../out/monaco-editor/dev/vs'
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -186,16 +186,22 @@ suite(`Smoke Test '${testInfo.packager}' on '${testInfo.browser}'`, () => {
|
||||||
await page.waitForSelector(`text=addEventListener`);
|
await page.waitForSelector(`text=addEventListener`);
|
||||||
|
|
||||||
// find the TypeScript worker
|
// find the TypeScript worker
|
||||||
const tsWorker = page.workers().find((worker) => {
|
|
||||||
const url = worker.url();
|
function findAsync(arr, fn) {
|
||||||
return /ts\.worker(\.[a-f0-9]+)?\.js$/.test(url) || /workerMain.js#typescript$/.test(url);
|
return Promise.all(arr.map(fn)).then((results) => {
|
||||||
|
return arr.find((_, i) => results[i]);
|
||||||
});
|
});
|
||||||
if (!tsWorker) {
|
|
||||||
assert.fail('Could not find TypeScript worker');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// check that the TypeScript worker exposes `ts` as a global
|
// check that the TypeScript worker exposes `ts` as a global
|
||||||
assert.strictEqual(await tsWorker.evaluate(`typeof ts`), 'object');
|
const tsWorker = await findAsync(
|
||||||
|
page.workers(),
|
||||||
|
async (page) => await page.evaluate(`typeof ts !== 'undefined'`)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!tsWorker) {
|
||||||
|
assert.fail('Could not find TypeScript worker');
|
||||||
|
}
|
||||||
|
|
||||||
// check that the TypeScript worker exposes the full `ts` as a global
|
// check that the TypeScript worker exposes the full `ts` as a global
|
||||||
assert.strictEqual(await tsWorker.evaluate(`typeof ts.optionDeclarations`), 'object');
|
assert.strictEqual(await tsWorker.evaluate(`typeof ts.optionDeclarations`), 'object');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue