Skip to content

Commit

Permalink
@W-17160682 Set SSR env var to 'true' in server-side rendering Jest p…
Browse files Browse the repository at this point in the history
…reset (#333)

* feat: inital visual testing setup

* Bring up the frameworks together

* Perf related tests

* Sample cmpts

* Adding the UTAM PO

* Add hydrate capability

* Aligning route names in lwr config

* Removing routes

* feat: added interactivity and visual regression tests

* Adding various cmpt tests

* Update the url

* utam issue fix

* Final cleanup

* Change the path to  visual testing output folders

* Moving perf tests out of the cmp level

* Addressing feedback

* Adding the section on performance tests

* Fixing the link addresses

* wdio config cleanup

* Better comments

* Changing imports to ESM

* Grouping together the script for SSR test execution

* Rebasing

* Updating the snapshot

* Update links in README

* Upgrade lwc and set SSR env var to true in ssr server preset

* Fixing the failing test after lwc upgrade

---------

Co-authored-by: abhagta <[email protected]>
Co-authored-by: lturanscaia <[email protected]>
  • Loading branch information
3 people authored Nov 9, 2024
1 parent 613d85b commit 242a1ee
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 73 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
"license": "MIT",
"devDependencies": {
"@babel/core": "^7.24.4",
"@lwc/compiler": "7.2.3",
"@lwc/engine-dom": "7.2.3",
"@lwc/engine-server": "7.2.3",
"@lwc/compiler": "8.1.2",
"@lwc/engine-dom": "8.1.2",
"@lwc/engine-server": "8.1.2",
"@lwc/module-resolver": "^8.1.0",
"@lwc/synthetic-shadow": "7.2.3",
"@lwc/wire-service": "7.2.3",
"@lwc/synthetic-shadow": "8.1.2",
"@lwc/wire-service": "8.1.2",
"@types/jest": "^29.5.12",
"@typescript-eslint/eslint-plugin": "^7.5.0",
"@typescript-eslint/parser": "^7.5.0",
Expand Down
1 change: 1 addition & 0 deletions packages/@lwc/jest-preset/ssr-server/jest-preset.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ const originalSSRPreset = require('../ssr/jest-preset.js');
module.exports = {
...originalSSRPreset,
snapshotSerializers: [],
setupFilesAfterEnv: [require.resolve('../ssr-server/jest.ssr-server.setupAfterEnv.js')],
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
beforeEach(() => {
process.env.SSR = 'true';
});

afterEach(() => {
delete process.env.SSR;
});
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ exports[`serializes component with different whitespace 1`] = `
<div
style="background-color: red !important;"
/>
<div />
<div
style="color: yellow;"
/>
<div
style="color: purple;"
/>
Expand Down
113 changes: 46 additions & 67 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2584,50 +2584,45 @@
resolved "https://registry.npmjs.org/@locker/trusted-types/-/trusted-types-0.22.5.tgz#cf78cfec2d97a68678c0660656e4bdef2d5abc3a"
integrity sha512-sHXROEFevqsNa8+Dl9Q46Ol7XYY8iD+KzdMj6HGVVFu6BY3Fb4sYiR257759V3PURrRcju0to4lDwkg7Qz0z0A==

"@lwc/babel-plugin-component@7.2.3":
version "7.2.3"
resolved "https://registry.npmjs.org/@lwc/babel-plugin-component/-/babel-plugin-component-7.2.3.tgz#9b65c5648c4602509aa64f1b19512c8a7df1e21e"
integrity sha512-ml2hRbqVwGdl9qKYgjZ8/2qJFDaXfqaTEcoafV6FEAtAmR6H02bL3WN50MyhKDLHj6gvO5RGkZk+K/CiBLuFfg==
"@lwc/babel-plugin-component@8.1.2":
version "8.1.2"
resolved "https://registry.npmjs.org/@lwc/babel-plugin-component/-/babel-plugin-component-8.1.2.tgz#8d4a8e275290f3fba04805d6f3753860e98b04b2"
integrity sha512-I0rns7Z76YT1N5qB45Lc5uDALwknt7mVuNG+HF/ZSKYLB9EGuwJwFwlGVVj80kY0PJBMMUT8wPbswUMiGcXuIA==
dependencies:
"@babel/helper-module-imports" "7.24.7"
"@babel/traverse" "^7.25.4"
"@babel/traverse" "^7.25.6"
"@babel/types" "^7.25.0"
"@lwc/errors" "7.2.3"
"@lwc/shared" "7.2.3"
"@lwc/errors" "8.1.2"
"@lwc/shared" "8.1.2"
line-column "~1.0.2"

"@lwc/compiler@7.2.3":
version "7.2.3"
resolved "https://registry.npmjs.org/@lwc/compiler/-/compiler-7.2.3.tgz"
integrity sha512-aKh5aGsJ0v7kNEjTuqfoHigSWFL/GriWzuFN8UKWulWWh1a/NDfYGEzh6l1AoKRbUlZsUQ2FSQYjoDoCrlQZUg==
"@lwc/compiler@8.1.2":
version "8.1.2"
resolved "https://registry.npmjs.org/@lwc/compiler/-/compiler-8.1.2.tgz#1a71faa4749b6e8d0efa91c5b63412379f173ca8"
integrity sha512-cO/ifkEouLz3xGYMIW1TRnw3Ynyx2vgsBLxqPwFlZI6TEyO5IIO7JA++yXVJOMtS/opVKD/1fultoBEyG3L6Ng==
dependencies:
"@babel/core" "7.25.2"
"@babel/plugin-transform-async-generator-functions" "7.25.4"
"@babel/plugin-transform-async-to-generator" "7.24.7"
"@babel/plugin-transform-class-properties" "7.25.4"
"@babel/plugin-transform-object-rest-spread" "7.24.7"
"@locker/babel-plugin-transform-unforgeables" "0.22.0"
"@lwc/babel-plugin-component" "7.2.3"
"@lwc/errors" "7.2.3"
"@lwc/shared" "7.2.3"
"@lwc/ssr-compiler" "7.2.3"
"@lwc/style-compiler" "7.2.3"
"@lwc/template-compiler" "7.2.3"

"@lwc/[email protected]":
version "7.2.3"
resolved "https://registry.npmjs.org/@lwc/engine-dom/-/engine-dom-7.2.3.tgz"
integrity sha512-hIjggwSrJRogStnoXzUbadDHAg/j9p2raH+7e96Pl9yG2HdexdosLNW68N3lFpgM39QYxZRTMple9TKMoCDfEw==
"@lwc/babel-plugin-component" "8.1.2"
"@lwc/errors" "8.1.2"
"@lwc/shared" "8.1.2"
"@lwc/ssr-compiler" "8.1.2"
"@lwc/style-compiler" "8.1.2"
"@lwc/template-compiler" "8.1.2"

"@lwc/engine-[email protected]":
version "7.2.3"
resolved "https://registry.npmjs.org/@lwc/engine-server/-/engine-server-7.2.3.tgz"
integrity sha512-9SAUPhoIFAzdvJtO3sJiyXleIgopfKrxUyTbyrMobuIa072LQ+n1gzIxGY7JwKwXdi2/OxIg68PXifUGHPMjNQ==
"@lwc/engine-[email protected]":
version "8.1.2"
resolved "https://registry.npmjs.org/@lwc/engine-dom/-/engine-dom-8.1.2.tgz#c71c21b53ea3679600224028f6e05d403e587726"
integrity sha512-zUkl384fyLDBSMCEMpkj0mNi9jyQT1AhWMrEAfzv1ouE0+LFVK27CtINRTcWBc/1TgzzvuHzyjkXHnOmIUfU9g==

"@lwc/[email protected]":
version "7.2.3"
resolved "https://registry.npmjs.org/@lwc/errors/-/errors-7.2.3.tgz#607416de1ca783f2f399ffc18471b0f819bb37fc"
integrity sha512-ApUrfG6VbEcbpOGTBzfcY9Wq1hh4zaPTrEYW59R7URQ8RS6YRDwsL0KXYJA605E6f61eMkQhRYvP6MbnH9MlOg==
"@lwc/[email protected]":
version "8.1.2"
resolved "https://registry.npmjs.org/@lwc/engine-server/-/engine-server-8.1.2.tgz#0585b80fe5b6729f9ce5892a384fd88d9b11f325"
integrity sha512-hRrw2jUEjthzIFLcHcqceHP/F/RWNGflouAQ1zdsqIhGQVKYzZGXJWa9enneKcgsd10tno4+2DZg8KbyD1tQww==

"@lwc/[email protected]":
version "8.1.2"
Expand All @@ -2641,54 +2636,38 @@
dependencies:
resolve "~1.22.8"

"@lwc/[email protected]":
version "7.2.3"
resolved "https://registry.npmjs.org/@lwc/shared/-/shared-7.2.3.tgz#9cb405263c6411184b33a4175a6d99b319e6cfd3"
integrity sha512-LJFZbrLWwDDdh9eUW6yt+0iyT+rXVu8TRmCvF+RdBKtzZFQ6aZcfw+avIfuzEkqHy3HXPRJi/Q7s6sZ5yMZqyg==

"@lwc/[email protected]":
version "8.1.2"
resolved "https://registry.npmjs.org/@lwc/shared/-/shared-8.1.2.tgz#01dbc51c2ec51927e3aff55ed0303e9235d6ff7f"
integrity sha512-2w0FecY2IUmpF0oqUweza6I+N8rGhr10FGjLksKUJq+qRW9nzzTYTZC/KeeSBQa6ABUcrYrh7j7ekupYov9HKg==

"@lwc/ssr-compiler@7.2.3":
version "7.2.3"
resolved "https://registry.npmjs.org/@lwc/ssr-compiler/-/ssr-compiler-7.2.3.tgz#540113a9e5dbd1be78cf25dec9e00d36a06a02d7"
integrity sha512-udJPGm6GC3meVcXg7xlzRBR8UzFryWLfsnkrtFD8Gz2NuLRVGDIedtkEELkdEyS0f+PpyNO8aLvA4VD/ydRoOg==
"@lwc/ssr-compiler@8.1.2":
version "8.1.2"
resolved "https://registry.npmjs.org/@lwc/ssr-compiler/-/ssr-compiler-8.1.2.tgz#9a49841aae08030c64464ba8e562cb2c2c094c10"
integrity sha512-qnEcPp7x9m0ioi7mD9Q8pCNBHhlydlxwS8b5j3M81122WSGXePq2CCz1lKUsGPoUKcS/6oBHcxdkaQ3Wsdl3ww==
dependencies:
"@lwc/shared" "7.2.3"
"@lwc/template-compiler" "7.2.3"
"@lwc/shared" "8.1.2"
"@lwc/template-compiler" "8.1.2"
acorn "8.12.1"
astring "^1.9.0"
estree-toolkit "^1.7.7"
estree-toolkit "^1.7.8"
immer "^10.1.1"
meriyah "^5.0.0"

"@lwc/style-compiler@7.2.3":
version "7.2.3"
resolved "https://registry.npmjs.org/@lwc/style-compiler/-/style-compiler-7.2.3.tgz#c310d8ea4833f1485b0aa0c085e45ddfeb3420a6"
integrity sha512-GWCdLxunHV2tTD7TBFEmEhby2s3RYK6xtggENCidGaVEPYzJDFD/o8d1j8NviLIxOUAm+yVp9feloebylrBC2g==
"@lwc/style-compiler@8.1.2":
version "8.1.2"
resolved "https://registry.npmjs.org/@lwc/style-compiler/-/style-compiler-8.1.2.tgz#5bfebb6c3c283ba33ed91b353f87a09de1841175"
integrity sha512-XVV5wAL8x+/rhrsRHmGL+0HgGzq3ixhKz8rUZ8sDycujspFEym0L6ysmyCpuDvN/T95+F4zK1iQUHStZJ8dHpA==
dependencies:
"@lwc/shared" "7.2.3"
postcss "~8.4.41"
"@lwc/shared" "8.1.2"
postcss "~8.4.47"
postcss-selector-parser "~6.1.2"
postcss-value-parser "~4.2.0"

"@lwc/[email protected]":
version "7.2.3"
resolved "https://registry.npmjs.org/@lwc/synthetic-shadow/-/synthetic-shadow-7.2.3.tgz"
integrity sha512-TkcCII7S/tjrE8HZCNyRb+7jqPBzk+b24Iqo06karUx0yqJfOZls6Asj8PS8enp6BybTtQGNtfkc9xHIINdehA==

"@lwc/[email protected]":
version "7.2.3"
resolved "https://registry.npmjs.org/@lwc/template-compiler/-/template-compiler-7.2.3.tgz#d59f38d3420914ab51e93fed3384897cc63c4832"
integrity sha512-yoebVc9EhQg8KsYMUPcldCzNR72kfcBGc9ZXv/gprhQBTpmKM4YWX+ftRFPpdv86IU15XiFsZbX2tiTvt7P+ZQ==
dependencies:
"@lwc/errors" "7.2.3"
"@lwc/shared" "7.2.3"
acorn "~8.12.1"
astring "~1.9.0"
he "~1.2.0"
"@lwc/[email protected]":
version "8.1.2"
resolved "https://registry.npmjs.org/@lwc/synthetic-shadow/-/synthetic-shadow-8.1.2.tgz#06e50f40f791e2f00eb6058623a6a4055bb75d04"
integrity sha512-DlCsZXegpjTzwSHjo56Qf8sMoljX+ohPh7YNPKexo2vy3S6LfT2QlxWL3Cx6LdzK2QEIstRoLAbyj2ftWhbFUg==

"@lwc/[email protected]":
version "8.1.2"
Expand All @@ -2701,10 +2680,10 @@
astring "~1.9.0"
he "~1.2.0"

"@lwc/wire-service@7.2.3":
version "7.2.3"
resolved "https://registry.npmjs.org/@lwc/wire-service/-/wire-service-7.2.3.tgz"
integrity sha512-tCRWElUYoLis2j9DUnZ899KzzqpgU7hmdwcanSVfk5sjQ5oXMigTbRBV5b9MKNJsJXSC9IScihksTjJuBdPXvg==
"@lwc/wire-service@8.1.2":
version "8.1.2"
resolved "https://registry.npmjs.org/@lwc/wire-service/-/wire-service-8.1.2.tgz#a805ce69b3439c537ad5a309a4b7277062d17a93"
integrity sha512-IqhRQ2vdXMNeWzpFfu1HmcPqsqt5OHeRxd0wMgtL/QUR116XaDaMrqUpD9YJUcxfWdp84JPJwHH/TMs/3j5jxA==

"@lwrjs/[email protected]":
version "0.14.0"
Expand Down

0 comments on commit 242a1ee

Please sign in to comment.