File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
packages/core/src/extensions/UniqueID Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -52,14 +52,15 @@ const UniqueID = Extension.create({
5252 types : [ ] ,
5353 generateID : ( ) => {
5454 // Use mock ID if tests are running.
55- if ( ( window as any ) . __TEST_OPTIONS ) {
56- if ( ( window as any ) . __TEST_OPTIONS . mockID === undefined ) {
57- ( window as any ) . __TEST_OPTIONS . mockID = 0 ;
55+ if ( typeof window !== "undefined" && ( window as any ) . __TEST_OPTIONS ) {
56+ const testOptions = ( window as any ) . __TEST_OPTIONS ;
57+ if ( testOptions . mockID === undefined ) {
58+ testOptions . mockID = 0 ;
5859 } else {
59- ( window as any ) . __TEST_OPTIONS . mockID ++ ;
60+ testOptions . mockID ++ ;
6061 }
6162
62- return ( window as any ) . __TEST_OPTIONS . mockID . toString ( ) as string ;
63+ return testOptions . mockID . toString ( ) as string ;
6364 }
6465
6566 return v4 ( ) ;
You can’t perform that action at this time.
0 commit comments