diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6c9b00c4..5109682f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -49,4 +49,5 @@ jobs: shell: bash run: | npm run report:versions + npm run test:install npm run test:run diff --git a/package.json b/package.json index 9fc83935..ef23d46b 100644 --- a/package.json +++ b/package.json @@ -58,8 +58,8 @@ "start:example:server:python": "npm run start:server:python --workspace packages/examples", "release:prepare": "npm run reset:repo && npm ci && npm run build && npm run lint && npm run test:run", "reset:repo": "git clean -f -X -d", - "test": "npm run test:webdriverio", - "test:run": "npm run test:webdriverio:run", + "test": "npm run test:playwright", + "test:run": "npm run test:playwright:run", "test:webdriverio": "vitest", "test:webdriverio:run": "vitest --run", "test:playwright": "vitest --config vitest.debug.config.ts", diff --git a/packages/wrapper-react/test/index.test.tsx b/packages/wrapper-react/test/index.test.tsx index 76361ccc..5a3d2df6 100644 --- a/packages/wrapper-react/test/index.test.tsx +++ b/packages/wrapper-react/test/index.test.tsx @@ -98,17 +98,13 @@ describe('Test MonacoEditorReactComp', () => { }; const handleOnLoad = async (wrapper: MonacoEditorLanguageClientWrapper) => { + await wrapper.updateCodeResources({ + main: { + text: 'goodbye world', + fileExt: 'js' + } + }); count++; - - setTimeout(async () => { - await wrapper.updateCodeResources({ - main: { - text: 'goodbye world', - fileExt: 'js' - } - }); - }, 100); - }; render(); }); diff --git a/packages/wrapper/test/languageClientWrapper.test.ts b/packages/wrapper/test/languageClientWrapper.test.ts index 74d230c5..01c4dea1 100644 --- a/packages/wrapper/test/languageClientWrapper.test.ts +++ b/packages/wrapper/test/languageClientWrapper.test.ts @@ -4,7 +4,7 @@ * ------------------------------------------------------------------------------------------ */ import { describe, expect, test } from 'vitest'; -import { LanguageClientConfig, LanguageClientWrapper, MonacoEditorLanguageClientWrapper } from 'monaco-editor-wrapper'; +import { LanguageClientWrapper, MonacoEditorLanguageClientWrapper } from 'monaco-editor-wrapper'; import { createWrapperConfigExtendedApp } from './helper.js'; describe('Test LanguageClientWrapper', () => { @@ -18,37 +18,28 @@ describe('Test LanguageClientWrapper', () => { }); test('Constructor: no config', async () => { - // create a web worker to pass to the wrapper - const worker = new Worker('./worker/langium-server.ts', { - type: 'module', - name: 'Langium LS', - }); - const languageClientConfig: LanguageClientConfig = { - clientOptions: { - documentSelector: ['javascript'] - }, - connection: { - options: { - $type: 'WorkerDirect', - worker + const languageClientWrapper = new LanguageClientWrapper({ + languageClientConfig: { + clientOptions: { + documentSelector: ['javascript'] + }, + connection: { + options: { + $type: 'WorkerDirect', + // create a web worker to pass to the wrapper + worker: new Worker('./worker/langium-server.ts', { + type: 'module', + name: 'Langium LS', + }) + } } } - }; - - const languageClientWrapper = new LanguageClientWrapper({ - languageClientConfig }); expect(languageClientWrapper).toBeDefined(); expect(languageClientWrapper.haveLanguageClient).toBeTruthy(); }); test('Dispose: direct worker is cleaned up afterwards', async () => { - // create a web worker to pass to the wrapper - const worker = new Worker('./worker/langium-server.ts', { - type: 'module', - name: 'Langium LS', - }); - // setup the wrapper const config = createWrapperConfigExtendedApp(); config.languageClientConfigs = { @@ -59,7 +50,11 @@ describe('Test LanguageClientWrapper', () => { connection: { options: { $type: 'WorkerDirect', - worker + // create a web worker to pass to the wrapper + worker: new Worker('./worker/langium-server.ts', { + type: 'module', + name: 'Langium LS', + }) } } }