diff --git a/.vscode/launch.json b/.vscode/launch.json index a750a697..30075f4c 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -28,6 +28,14 @@ "script": "${workspaceFolder}/scripts/dev/RunTests.ps1", "args": [] }, + { + // Run end-to-end tests + "name": "Test E2E", + "type": "PowerShell", + "request": "launch", + "script": "${workspaceFolder}/scripts/dev/RunE2ETests.ps1", + "args": [] + }, { // Run Tests for backend for current file in Debug mode "name": "BE-DebugTestFile", diff --git a/rsconcept/frontend/package.json b/rsconcept/frontend/package.json index 209f3c03..793b28a3 100644 --- a/rsconcept/frontend/package.json +++ b/rsconcept/frontend/package.json @@ -5,7 +5,8 @@ "type": "module", "scripts": { "generate": "lezer-generator src/components/RSInput/rslang/rslangFast.grammar -o src/components/RSInput/rslang/parser.ts && lezer-generator src/components/RSInput/rslang/rslangAST.grammar -o src/components/RSInput/rslang/parserAST.ts && lezer-generator src/components/RefsInput/parse/refsText.grammar -o src/components/RefsInput/parse/parser.ts", - "test": "jest && playwright test", + "test": "jest", + "teste2e": "playwright test", "dev": "vite --host", "build": "tsc && vite build", "lint": "eslint . --report-unused-disable-directives --max-warnings 0", diff --git a/rsconcept/frontend/vite.config.ts b/rsconcept/frontend/vite.config.ts index a54b0ac7..568f7ea0 100644 --- a/rsconcept/frontend/vite.config.ts +++ b/rsconcept/frontend/vite.config.ts @@ -73,6 +73,9 @@ export default ({ mode }: { mode: string }) => { alias: { '@': path.resolve(__dirname, './src') } + }, + optimizeDeps: { + exclude: ['react-scan'] } }); }; diff --git a/scripts/dev/RunE2ETests.ps1 b/scripts/dev/RunE2ETests.ps1 new file mode 100644 index 00000000..e8064c1c --- /dev/null +++ b/scripts/dev/RunE2ETests.ps1 @@ -0,0 +1,14 @@ +# Run tests + +$frontend = Resolve-Path -Path "$PSScriptRoot\..\..\rsconcept\frontend" + +function RunTests() { + TestFrontend +} + +function TestFrontend() { + Set-Location $frontend + & npm run teste2e +} + +RunTests \ No newline at end of file