Use custom websocket to avoid needing admin privileges.

This commit is contained in:
Dermot Duffy
2024-08-24 20:00:00 -07:00
parent 5a1d08f3ea
commit 429dd90972
47 changed files with 1219 additions and 874 deletions
@@ -144,6 +144,22 @@ describe('MessageManager', () => {
expect(consoleSpy).toBeCalled();
});
it('should set error with prefix', () => {
const consoleSpy = vi.spyOn(global.console, 'warn').mockReturnValue(undefined);
const api = createCardAPI();
const manager = new MessageManager(api);
manager.setErrorIfHigherPriority(new Error('generic error message'), 'PREFIX');
expect(manager.hasMessage()).toBeTruthy();
expect(manager.getMessage()).toEqual({
message: 'PREFIX: generic error message',
type: 'error',
});
expect(consoleSpy).toBeCalled();
});
it('should not set unknown error type', () => {
const consoleSpy = vi.spyOn(global.console, 'warn').mockReturnValue(undefined);