From 9c1eb60c849003174d8b5d4c2fd0f9feeb85eb70 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Fri, 24 Jan 2025 15:39:20 -0500 Subject: [PATCH] test(ssr): remove env var, test coverage (#5139) * test(ssr): remove SSR tests env var * test: add code coverage --- .github/workflows/unit.yml | 3 --- .../src/__tests__/fixtures.spec.ts | 4 +--- vitest.config.mjs | 21 ++++++++++++------- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml index a7ba841f04..7bda4671fe 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -66,9 +66,6 @@ jobs: run: yarn test:types - name: Run unit tests run: yarn test:ci - # TODO [#4815]: enable all SSR v2 tests - - name: Run experimental SSR fixture tests - run: TEST_SSR_COMPILER=1 yarn test packages/@lwc/ssr-compiler/src/__tests__/fixtures.spec.ts - name: Upload unit test coverage report uses: actions/upload-artifact@v4 with: diff --git a/packages/@lwc/ssr-compiler/src/__tests__/fixtures.spec.ts b/packages/@lwc/ssr-compiler/src/__tests__/fixtures.spec.ts index 6e5cb3bcf9..bc8aa372ad 100644 --- a/packages/@lwc/ssr-compiler/src/__tests__/fixtures.spec.ts +++ b/packages/@lwc/ssr-compiler/src/__tests__/fixtures.spec.ts @@ -77,9 +77,7 @@ async function compileFixture({ input, dirname }: { input: string; dirname: stri return outputFile; } -// We will enable this for realsies once all the tests are passing, but for now having the env var avoids -// running these tests in CI while still allowing for local testing. -describe.runIf(process.env.TEST_SSR_COMPILER).concurrent('fixtures', () => { +describe.concurrent('fixtures', () => { testFixtureDir( { root: path.resolve(__dirname, '../../../engine-server/src/__tests__/fixtures'), diff --git a/vitest.config.mjs b/vitest.config.mjs index 70cd0f0057..eb11f9cb21 100644 --- a/vitest.config.mjs +++ b/vitest.config.mjs @@ -29,17 +29,24 @@ export default defineConfig({ '**/packages/@lwc/perf-benchmarks-components/**', '**/packages/@lwc/perf-benchmarks/**', '**/playground/**', - // These are not production-ready yet - '**/packages/@lwc/ssr-compiler/**', - '**/packages/@lwc/ssr-runtime/**', // This just re-exports other packages '**/packages/lwc/**', ], thresholds: { - branches: 95, - functions: 95, - lines: 95, - statements: 95, + // SSR compiler/runtime is relatively newer, so has lower thresholds for now + '**/packages/@lwc/ssr-*/**': { + branches: 90, + functions: 60, + lines: 85, + statements: 85, + }, + + '!**/packages/@lwc/ssr-*/**': { + branches: 95, + functions: 95, + lines: 95, + statements: 95, + }, }, reporter: [ 'clover',