mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 06:33:55 +01:00
[clsi-cache] check compiler settings before using compile from cache (#24845)
* [web] provide an actual rootFolder from EditorProviders in tests - Fixup SocketIOMock and ShareJS mocks to provide the complete interface - Extend SocketIOMock interface to count event listeners - Fixup test that did not expect to find a working rootDoc * [web] expose imageName from ProjectContext * [clsi-cache] check compiler settings before using compile from cache * [web] avoid fetching initial compile from clsi-cache in PDF detach tab GitOrigin-RevId: e3c754a7ceca55f03a317e1bc8ae45ed12cc2f02
This commit is contained in:
@@ -277,13 +277,34 @@ if (typeof io === 'undefined' || !io) {
|
||||
current = SocketShimV2
|
||||
}
|
||||
|
||||
export class SocketIOMock extends EventEmitter {
|
||||
export class SocketIOMock extends SocketShimBase {
|
||||
constructor() {
|
||||
super(new EventEmitter())
|
||||
this.socket = {
|
||||
get connected() {
|
||||
return false
|
||||
},
|
||||
get sessionid() {
|
||||
return undefined
|
||||
},
|
||||
get transport() {
|
||||
return {}
|
||||
},
|
||||
get transports() {
|
||||
return []
|
||||
},
|
||||
|
||||
connect() {},
|
||||
disconnect(reason) {},
|
||||
}
|
||||
}
|
||||
|
||||
addListener(event, listener) {
|
||||
this.on(event, listener)
|
||||
this._socket.on(event, listener)
|
||||
}
|
||||
|
||||
removeListener(event, listener) {
|
||||
this.off(event, listener)
|
||||
this._socket.off(event, listener)
|
||||
}
|
||||
|
||||
disconnect() {
|
||||
@@ -294,6 +315,10 @@ export class SocketIOMock extends EventEmitter {
|
||||
// Round-trip through JSON.parse/stringify to simulate (de-)serializing on network layer.
|
||||
this.emit(...JSON.parse(JSON.stringify(args)))
|
||||
}
|
||||
|
||||
countEventListeners(event) {
|
||||
return this._socket.events[event].length
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
|
||||
Reference in New Issue
Block a user