Skip to content

Commit

Permalink
Fixes CI
Browse files Browse the repository at this point in the history
  • Loading branch information
hediet committed Jul 26, 2024
1 parent d4bb0a8 commit 93a0a2d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
1 change: 1 addition & 0 deletions test/smoke/amd/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<script src="../../../out/monaco-editor/dev/vs/loader.js"></script>
<script>
require.config({
baseUrl: new URL('..', document.baseURI).toString(),
paths: {
vs: '../../../out/monaco-editor/dev/vs'
}
Expand Down
20 changes: 13 additions & 7 deletions test/smoke/smoke.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,16 +186,22 @@ suite(`Smoke Test '${testInfo.packager}' on '${testInfo.browser}'`, () => {
await page.waitForSelector(`text=addEventListener`);

// find the TypeScript worker
const tsWorker = page.workers().find((worker) => {
const url = worker.url();
return /ts\.worker(\.[a-f0-9]+)?\.js$/.test(url) || /workerMain.js#typescript$/.test(url);
});
if (!tsWorker) {
assert.fail('Could not find TypeScript worker');

function findAsync(arr, fn) {
return Promise.all(arr.map(fn)).then((results) => {
return arr.find((_, i) => results[i]);
});
}

// 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
assert.strictEqual(await tsWorker.evaluate(`typeof ts.optionDeclarations`), 'object');
Expand Down

0 comments on commit 93a0a2d

Please sign in to comment.