File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 66 */
77import { isFalse } from './assert' ;
88
9- let trustedSignals : WeakSet < object > ;
9+ let trustedSignals : WeakSet < object > | undefined ;
1010
1111export function setTrustedSignalSet ( signals : WeakSet < object > ) {
1212 isFalse ( trustedSignals , 'Trusted Signal Set is already set!' ) ;
1313
1414 trustedSignals = signals ;
15+
16+ // Only used in LWC's Karma. Contained within the set function as there are multiple imports of
17+ // this module. Placing it here ensures we reference the import where the trustedSignals set is maintained
18+ if ( process . env . NODE_ENV === 'test-karma-lwc' ) {
19+ // Used to reset the global state between test runs
20+ ( globalThis as any ) . __lwcResetTrustedSignalsSetForTest = ( ) => ( trustedSignals = undefined ) ;
21+ }
1522}
1623
1724export function addTrustedSignal ( signal : object ) {
You can’t perform that action at this time.
0 commit comments