( public readonly seed: number, server: TestServer<TLRecord> )
| 67 | hasLoaded = false |
| 68 | |
| 69 | constructor( |
| 70 | public readonly seed: number, |
| 71 | server: TestServer<TLRecord> |
| 72 | ) { |
| 73 | super(seed) |
| 74 | |
| 75 | this.id = uniqueId() |
| 76 | this.store = createTLStore({ schema, id: this.id }) |
| 77 | this.socketPair = new TestSocketPair(this.id, server) |
| 78 | this.client = new TLSyncClient<TLRecord>({ |
| 79 | store: this.store, |
| 80 | socket: this.socketPair.clientSocket, |
| 81 | onSyncError: (reason) => { |
| 82 | throw new Error('onSyncError:' + reason) |
| 83 | }, |
| 84 | onLoad: () => { |
| 85 | this.editor = new FuzzEditor(this.id, this.seed, this.store) |
| 86 | }, |
| 87 | presence: createPresenceStateDerivation( |
| 88 | computed('', () => |
| 89 | UserRecordType.create({ |
| 90 | id: createUserId(this.id), |
| 91 | name: 'test', |
| 92 | color: 'red', |
| 93 | }) |
| 94 | ) |
| 95 | )(this.store), |
| 96 | }) |
| 97 | |
| 98 | disposables.push(() => { |
| 99 | this.client.close() |
| 100 | }) |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | function assertPeerStoreIsUsable(peer: FuzzTestInstance) { |
nothing calls this directly
no test coverage detected