-
Notifications
You must be signed in to change notification settings - Fork 394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(integration-karma): migrate to playwright/vitest #4594
Open
cardoso
wants to merge
122
commits into
salesforce:master
Choose a base branch
from
cardoso:vitest-browser
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 19 commits
Commits
Show all changes
122 commits
Select commit
Hold shift + click to select a range
ff6631c
chore(@lwc/integration-karma): migrate to vitest
cardoso 4ea2f54
chore(@lwc/integration-karma): tsify test-utils
cardoso 86ed5f4
chore(@lwc/integration-karma): compatibility layer
cardoso 72f3ede
chore(@lwc/integration-karma): fix console
cardoso 8474bec
chore(@lwc/integration-karma): fix resolution
cardoso a7c0e39
chore(@lwc/integration-karma): resolve modules
cardoso 8712d71
fix(@lwc/integration-karma): composedPath tests
cardoso 70bed5a
chore: add composedPath helpers
cardoso a0ed880
fix: event-methods
cardoso 51cc9fa
feat: use vitest mock
cardoso 3ef0206
fix: starting lwc vitest plugin from scratch
cardoso de2bb0a
fix: simplified lwc vitest plugin 300+ tests pass
cardoso 9fd8b3b
fix: added jasmine.createSpy() compat
cardoso a3c3751
fix: implemented toEqualWireSettings
cardoso 9e7798f
fix: template imports
cardoso d52038f
fix: jasmine createSpy
cardoso f5b4dc7
chore: update plugin
cardoso 3a32fcd
Merge branch 'master' of https:/salesforce/lwc into vites…
cardoso c197eb3
chore: remove screenshots
cardoso 096008b
chore: remove more screenshots
cardoso 68d7ea1
chore: git ignore screenshots
cardoso 798a969
fix: jasmine createSpy
cardoso 486a949
fix: revert freezeTemplate test
cardoso 1970bbb
fix: polyfill jasmine.arrayWithExactContents
cardoso 235ef5c
chore: revert more test changes
cardoso 7f11657
fix: css imports
cardoso 4e30c2c
fix: some wire tests
cardoso dc65971
fix: enable dynamic components
cardoso b49c646
fix: enable dynamic components
cardoso dc6299f
fix: polyfill spy.and.returnValue
cardoso ebfa2be
Merge branch 'master' of https:/salesforce/lwc into vites…
cardoso 2671dfa
fix: html rootDir resolution
cardoso 6cf87e1
fix: update done callbacks to promises
cardoso 5a46cfb
fix: polyfill spy.and.callFake
cardoso 4bc1d5d
fix: add toHaveSize matcher
cardoso 908a076
fix: polyfill createSpy().calls.reset()
cardoso d5ab33d
fix: polyfill spyOn().calls
cardoso fb02d76
fix: polyfill jasmine.any
cardoso a8f41b4
fix: polyfill spyOn().and.callThrough
cardoso daac79a
fix: done callback to promise
cardoso f48aa83
fix: polyfill xit
cardoso 3d8854d
fix: use mockClear for callThrough polyfill
cardoso 59036eb
fix: stub NATIVE_SHADOW env
cardoso 70b32b8
fix: expect toMatch should receive string
cardoso c2aa02a
fix: polyfill xdescribe
cardoso cf26d0c
fix: disable native custom element lifecycle
cardoso f72a3c2
fix: polyfill spy.calls.mostRecent()
cardoso 64a902b
fix: constructor import
cardoso 87d1d51
fix: jasmine polyfills any, objectContaining, and arrayWithExactContents
cardoso 9cce7e6
chore: add test:browser:debug script
cardoso 45e7aca
fix: error in test/rendeing/slotting
cardoso ef4765e
fix: passWithNoTests
cardoso d5a9d45
chore: update vitest packages
cardoso dc5824c
feat: disable vite postcss processing
cardoso ee657fa
fix: add LWC_VERSION env
cardoso 44a9bf9
fix: disable css?scoped=true vite transform
cardoso 2f298db
fix: expect toMatch string
cardoso 53c9716
fix: polyfill createSpy().calls.count()
cardoso 03935de
fix: patch vite:css plugin
cardoso 6a9fb2c
chore: add wip script for test-hydration
cardoso 50ad791
test(hydration): implement plugin
cardoso de390dd
chore: simpligy hydration plugin
cardoso 679a5af
chore: simplify generated test code
cardoso 7a9ecfc
fix: sanitizeHtmlContent
cardoso cecee30
fix: add filename to vm scriot
cardoso 6fe2d02
fix: setHooks in hydration tests
cardoso cb6f47a
Merge branch 'master' of https:/salesforce/lwc into vites…
cardoso d755571
Merge branch 'master' of https:/salesforce/lwc into vites…
cardoso 95c4587
fix: types in lwc vitest plugin
cardoso fdbb7e8
fix: run ffi transform
cardoso 4478da4
fix: inject @lwc/engine-dom script tag
cardoso b3b89b4
Merge branch 'master' of https:/salesforce/lwc into vites…
cardoso 1acf596
fix: iife source map
cardoso 47a2628
chore: remove unused Watcher.ts
cardoso a7a4fc5
Merge branch 'master' of https:/salesforce/lwc into vites…
cardoso f962501
Merge branch 'master' of https:/salesforce/lwc into vites…
cardoso c109fbf
fix: hycration test source maps
cardoso 15feb98
Merge branch 'master' of https:/salesforce/lwc into vites…
cardoso 4756b0e
fix: not.toHaveSize matcher
cardoso e3613fe
fix: prevent some comments from disappearing
cardoso f1471a4
fix: keep version comments
cardoso d7e97db
Merge branch 'master' of https:/salesforce/lwc into vites…
cardoso b4309d9
fix: support ENABLE_ARIA_REFLECTION_GLOBAL_POLYFILL
cardoso 477d555
fix: support ENABLE_SYNTHETIC_SHADOW_IN_HYDRATION
cardoso f739211
fix: support DISABLE_STATIC_CONTENT_OPTIMIZATION
cardoso a9f4801
chore: revert changes to rollup-plugin
cardoso 68329a2
fix: improve test failure location for ShadowRoot.elementsFromPoint
cardoso b3ee369
fix: remove dependency of test-utils on lwc
cardoso 8f18ec7
chore: remove unused toEqualWireSettings matcher
cardoso dece5dd
fix: watch files
cardoso 9170f97
fix: watch files in test-hydration
cardoso 78cba8f
revert: watch files (error with invalid namespace symbol)
cardoso c84b3ba
Merge branch 'master' of https:/salesforce/lwc into vites…
cardoso 87051b8
chore: split vitest setup files
cardoso 4050ee0
Merge branch 'master' of https:/salesforce/lwc into vites…
cardoso 0b3b0df
feat: speed up hydration tests by 2x
cardoso 26a7229
fix: disable passWithNoTests for hydration
cardoso 582e6c7
fix: remove unneeded ?iife query param
cardoso 012bd64
chore: separate config plugin
cardoso fb897bb
chore: separate vite plugins in folder
cardoso 3f5e923
fix: different names for tests
cardoso 3bd9cdf
Merge branch 'master' of https:/salesforce/lwc into vites…
cardoso 8063042
chore: update vitest to 2.1.3
cardoso 1897f92
chore: shorten test names
cardoso ca1f992
fix: use transform to replace NODE_ENV
cardoso 263dd0f
chore: consolidate plugins
cardoso a7d7330
fix: handling API_VERSION env var in tests
cardoso 5acb1b5
chore: begin support for coverage
cardoso 0851ec8
chore: add workspace file
cardoso 6806648
fix: scripts running all tests
cardoso 69c72c9
fix: enable source maps
cardoso cc36de4
fix: enable excludeAfterRemap
cardoso 29ec4e5
Merge branch 'master' of https:/salesforce/lwc into vites…
cardoso 3b30a10
fix: move @vitest/browser dependency to root
cardoso b8d5312
chore: transition to webdriverio
cardoso 066549d
Merge branch 'master' of https:/salesforce/lwc into vites…
cardoso db88d27
Merge branch 'master' of https:/salesforce/lwc into vites…
cardoso 799ee56
feat: webdriverio browser config
cardoso 41990c0
Merge branch 'master' of https:/salesforce/lwc into vites…
cardoso 39e60e3
fix: import framework files via testerScripts
cardoso ce70151
fix: use global LWC in hydration tests
cardoso 7f838dc
Merge branch 'master' of https:/salesforce/lwc into vites…
cardoso File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,5 +103,6 @@ | |
"http-cache-semantics": "4.1.1", | ||
"semver": "7.6.0" | ||
}, | ||
"dependencies": {} | ||
"dependencies": {}, | ||
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,36 +17,6 @@ function testInvalidComponentConstructor(name, ctor) { | |
}); | ||
} | ||
|
||
beforeAll(function () { | ||
const getNormalizedFunctionAsString = (fn) => fn.toString().replace(/(\s|\n)/g, ''); | ||
|
||
jasmine.addMatchers({ | ||
toEqualWireSettings: function () { | ||
return { | ||
compare: function (actual, expected) { | ||
Object.keys(actual).forEach((currentKey) => { | ||
const normalizedActual = Object.assign({}, actual[currentKey], { | ||
config: getNormalizedFunctionAsString(actual[currentKey].config), | ||
}); | ||
|
||
const normalizedExpected = Object.assign({}, expected[currentKey], { | ||
config: getNormalizedFunctionAsString( | ||
expected[currentKey].config || function () {} | ||
), | ||
}); | ||
|
||
expect(normalizedActual).toEqual(normalizedExpected); | ||
}); | ||
|
||
return { | ||
pass: true, | ||
Comment on lines
-20
to
-42
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This beforeAll() was just adding a custom matcher. I moved it to the test scripts in karma and implemented the equivalent in the vitest scripts. |
||
}; | ||
}, | ||
}; | ||
}, | ||
}); | ||
}); | ||
|
||
testInvalidComponentConstructor('null', null); | ||
testInvalidComponentConstructor('undefined', undefined); | ||
testInvalidComponentConstructor('String', 'component'); | ||
|
Binary file added
BIN
+97.1 KB
...-is-not-a-function-should-log-an-error-if-event-handler-is-not-a-function-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+58.7 KB
...k-when-element-moves-between-documents-element-defined-after-engine-loads-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+58.7 KB
...-when-element-moves-between-documents-element-defined-before-engine-loads-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+58.7 KB
...nts-registry-adoptedCallback-does-not-call-adoptedCallback-if-unnecessary-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+97.2 KB
...nshots__/index.spec.js/custom-elements-registry-basic-can-create-elements-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+58.7 KB
...ds-can-do-customElements-get---for-element-registered-before-engine-loads-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+58.7 KB
...o-customElements-whenDefined---for-element-registered-before-engine-loads-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+58.7 KB
...register-element-when-another-element-was-registered-before-engine-loaded-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+58.7 KB
...-engine-loads-can-upgrade-elements-that-existed-before-engine-loads---LWC-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+58.7 KB
...ine-loads-can-upgrade-elements-that-existed-before-engine-loads---vanilla-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+58.7 KB
...iple-elements-with-same-tag-name-that-exist-before-engine-loads---vanilla-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+58.7 KB
...en-another-element-with-same-tag-name-was-registered-before-engine-loaded-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+58.7 KB
...e-loaded-creates-elements-in-first-engine---with-CustomElementConstructor-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+58.7 KB
...C-engine-loaded-creates-elements-in-first-engine---with-LWC-createElement-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+58.7 KB
...-loaded-creates-elements-in-second-engine---with-CustomElementConstructor-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+58.7 KB
...-engine-loaded-creates-elements-in-second-engine---with-LWC-createElement-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does adding this
packageManager
do?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think installing yarn with Node 22 corepack does that. It shows up every time I run yarn. I intend to remove this diff once I'm done.