File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66 "type" : " module" ,
77 "scripts" : {
88 "test" : " playwright test" ,
9- "test:e2e" : " playwright test" ,
109 "lint" : " eslint script.js sw.js" ,
1110 "lint:fix" : " eslint --fix script.js sw.js" ,
1211 "test:serve" : " http-server . -p 4173 -c-1 --silent" ,
Original file line number Diff line number Diff line change 1111 const RIFT_NON_CONFLICT_CHECK_INTERVAL = 5 ;
1212 const testParams = new URLSearchParams ( window . location . search ) ;
1313 const isLocalHost = [ 'localhost' , '127.0.0.1' , '0.0.0.0' ] . includes ( window . location . hostname ) ;
14- const TEST_MODE = ( testParams . get ( 'testHooks' ) === '1' && isLocalHost )
15- || ( testParams . get ( 'e2e' ) === '1' && ( isLocalHost || navigator . webdriver === true ) ) ;
14+ const testHooksEnabled = testParams . get ( 'testHooks' ) === '1' && isLocalHost ;
15+ const e2eModeEnabled = testParams . get ( 'e2e' ) === '1' && ( isLocalHost || navigator . webdriver ) ;
16+ const TEST_MODE = testHooksEnabled || e2eModeEnabled ;
1617 const boardEl = document . getElementById ( 'board' ) ;
1718 const statusEl = document . getElementById ( 'status' ) ;
1819 const difficultyEl = document . getElementById ( 'difficulty' ) ;
891892
892893 function registerRiftExtension ( extension = { } ) {
893894 const dispose = [ ] ;
894- [ 'onTrigger' , 'onResolve' ] . forEach ( hookName => {
895+ Object . keys ( riftExtensionHooks ) . forEach ( hookName => {
895896 const handler = extension [ hookName ] ;
896897 if ( typeof handler !== 'function' ) return ;
897898 riftExtensionHooks [ hookName ] . push ( handler ) ;
11391140 forceEvaluateRift ( ) {
11401141 evaluateRiftTrigger ( 'player-move' , { force :true , conflictIntroduced :true } ) ;
11411142 } ,
1143+ async forceRift ( ) {
1144+ if ( riftState . active || riftSequenceRunning ) return ;
1145+ await triggerRiftEvent ( ) ;
1146+ } ,
11421147 getRiftState ( ) {
11431148 return {
11441149 ...serializeRiftState ( ) ,
You can’t perform that action at this time.
0 commit comments