@servicetitan/log-service 28.5.0 → 30.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/global-error-handler.d.ts.map +1 -1
  2. package/dist/global-error-handler.js.map +1 -1
  3. package/dist/index.d.ts +2 -2
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/log-service.d.ts +1 -1
  6. package/dist/log-service.d.ts.map +1 -1
  7. package/dist/log-storage.js +1 -1
  8. package/dist/log-storage.js.map +1 -1
  9. package/dist/log.d.ts +3 -3
  10. package/dist/log.d.ts.map +1 -1
  11. package/dist/log.js +1 -1
  12. package/dist/log.js.map +1 -1
  13. package/package.json +6 -6
  14. package/src/global-error-handler.ts +2 -2
  15. package/src/index.ts +2 -2
  16. package/src/log-service.tsx +1 -1
  17. package/src/log-storage.ts +1 -1
  18. package/src/log.ts +4 -4
  19. package/dist/__tests__/__mocks__/broadcast-channel.d.ts +0 -13
  20. package/dist/__tests__/__mocks__/broadcast-channel.d.ts.map +0 -1
  21. package/dist/__tests__/__mocks__/broadcast-channel.js +0 -79
  22. package/dist/__tests__/__mocks__/broadcast-channel.js.map +0 -1
  23. package/dist/__tests__/__mocks__/index.d.ts +0 -2
  24. package/dist/__tests__/__mocks__/index.d.ts.map +0 -1
  25. package/dist/__tests__/__mocks__/index.js +0 -2
  26. package/dist/__tests__/__mocks__/index.js.map +0 -1
  27. package/dist/__tests__/connection-service.test.d.ts +0 -2
  28. package/dist/__tests__/connection-service.test.d.ts.map +0 -1
  29. package/dist/__tests__/connection-service.test.js +0 -43
  30. package/dist/__tests__/connection-service.test.js.map +0 -1
  31. package/dist/__tests__/global-error-handler.test.d.ts +0 -2
  32. package/dist/__tests__/global-error-handler.test.d.ts.map +0 -1
  33. package/dist/__tests__/global-error-handler.test.js +0 -174
  34. package/dist/__tests__/global-error-handler.test.js.map +0 -1
  35. package/dist/__tests__/log-config-provider.test.d.ts +0 -2
  36. package/dist/__tests__/log-config-provider.test.d.ts.map +0 -1
  37. package/dist/__tests__/log-config-provider.test.js +0 -20
  38. package/dist/__tests__/log-config-provider.test.js.map +0 -1
  39. package/dist/__tests__/log-sender.test.d.ts +0 -2
  40. package/dist/__tests__/log-sender.test.d.ts.map +0 -1
  41. package/dist/__tests__/log-sender.test.js +0 -117
  42. package/dist/__tests__/log-sender.test.js.map +0 -1
  43. package/dist/__tests__/log-service.test.d.ts +0 -2
  44. package/dist/__tests__/log-service.test.d.ts.map +0 -1
  45. package/dist/__tests__/log-service.test.js +0 -49
  46. package/dist/__tests__/log-service.test.js.map +0 -1
  47. package/dist/__tests__/log-storage.test.d.ts +0 -2
  48. package/dist/__tests__/log-storage.test.d.ts.map +0 -1
  49. package/dist/__tests__/log-storage.test.js +0 -139
  50. package/dist/__tests__/log-storage.test.js.map +0 -1
  51. package/dist/__tests__/log.test.d.ts +0 -2
  52. package/dist/__tests__/log.test.d.ts.map +0 -1
  53. package/dist/__tests__/log.test.js +0 -137
  54. package/dist/__tests__/log.test.js.map +0 -1
  55. package/dist/__tests__/serialize-with-metadata.test.d.ts +0 -2
  56. package/dist/__tests__/serialize-with-metadata.test.d.ts.map +0 -1
  57. package/dist/__tests__/serialize-with-metadata.test.js +0 -27
  58. package/dist/__tests__/serialize-with-metadata.test.js.map +0 -1
@@ -1,174 +0,0 @@
1
- import { serializeWithMetadata } from '../serialize-with-metadata';
2
- import { GlobalErrorHandler } from '../global-error-handler';
3
- describe(`[log-service] ${GlobalErrorHandler.name}`, () => {
4
- const log = { error: jest.fn() };
5
- let handler;
6
- beforeAll(() => (handler = new GlobalErrorHandler(log)));
7
- beforeEach(() => jest.clearAllMocks());
8
- describe('onError', () => {
9
- const line = 12;
10
- const column = 34;
11
- const url = 'http://example.com';
12
- let message;
13
- let error;
14
- let isUnhandled;
15
- beforeEach(() => {
16
- message = 'Oops!';
17
- error = new Error('Something went wrong');
18
- isUnhandled = undefined;
19
- });
20
- const subject = () => handler.onError(message, url, line, column, error, isUnhandled);
21
- test('reports error', () => {
22
- subject();
23
- expect(log.error).toHaveBeenCalledWith({
24
- error,
25
- message: error.message,
26
- category: 'UnhandledError',
27
- code: 'UnhandledError',
28
- data: undefined,
29
- });
30
- });
31
- describe('when error was handled', () => {
32
- beforeEach(() => (isUnhandled = false));
33
- test('omits category and code', () => {
34
- subject();
35
- expect(log.error).toHaveBeenCalledWith({
36
- error,
37
- message: error.message,
38
- });
39
- });
40
- });
41
- describe('with no error', () => {
42
- beforeEach(() => (error = undefined));
43
- test('reports synthetic error', () => {
44
- subject();
45
- expect(log.error).toHaveBeenCalledWith({
46
- error: expect.objectContaining({
47
- message: `Message - ${message}`,
48
- stack: expect.stringContaining(`${url}:${line}:${column}`),
49
- }),
50
- message: `Message - ${message}`,
51
- category: 'UnhandledError',
52
- code: 'NonUniform',
53
- });
54
- });
55
- describe('when message is not a string', () => {
56
- beforeEach(() => (message = { foo: 'bar' }));
57
- test('serializes message', () => {
58
- subject();
59
- expect(log.error).toHaveBeenCalledWith(expect.objectContaining({
60
- message: `Message - ${serializeWithMetadata(message)}`,
61
- }));
62
- });
63
- });
64
- });
65
- describe('with a non-standard error', () => {
66
- beforeEach(() => (error = { data: 'foo' }));
67
- test('serializes error into message', () => {
68
- subject();
69
- expect(log.error).toHaveBeenCalledWith(expect.objectContaining({
70
- message: `Message - ${message};Error - ${serializeWithMetadata(error)}`,
71
- }));
72
- });
73
- });
74
- describe.each([
75
- 'gCrWeb',
76
- 'Geolocation',
77
- 'kCLErrorDomain',
78
- 'The last location provider was disabled',
79
- 'Location services are disabled',
80
- ])('when message contains "%s"', subString => {
81
- beforeEach(() => (message = `foo${subString}bar`));
82
- test('ignores error', () => {
83
- subject();
84
- expect(log.error).not.toHaveBeenCalled();
85
- });
86
- });
87
- describe('when report fails', () => {
88
- const reportError = new Error('Something went wrong');
89
- beforeEach(() => {
90
- jest.mocked(log.error).mockImplementation(() => {
91
- throw reportError;
92
- });
93
- });
94
- test('logs failure', () => {
95
- const consoleErrorSpy = jest.spyOn(console, 'error').mockImplementation(jest.fn());
96
- subject();
97
- expect(consoleErrorSpy).toHaveBeenCalledWith('@log-service/onError/failsafe', message);
98
- expect(consoleErrorSpy).toHaveBeenCalledWith('@log-service/onError/failsafe', reportError);
99
- });
100
- });
101
- });
102
- describe('onReject', () => {
103
- let reason;
104
- const subject = () => handler.onReject({ reason });
105
- describe('when reason is an Error', () => {
106
- const error = new Error('Oops!');
107
- beforeEach(() => (reason = error));
108
- test('reports error', () => {
109
- subject();
110
- expect(log.error).toHaveBeenCalledWith({
111
- error,
112
- message: error.message,
113
- });
114
- });
115
- });
116
- describe('when reason is not an error', () => {
117
- beforeEach(() => (reason = { foo: 'bar' }));
118
- test('reports synthetic error', () => {
119
- subject();
120
- const message = `Unhandled rejection - ${serializeWithMetadata(reason)}`;
121
- expect(log.error).toHaveBeenCalledWith({
122
- error: expect.objectContaining({ message }),
123
- message,
124
- code: 'NonUniform',
125
- });
126
- });
127
- });
128
- describe('when report fails', () => {
129
- const reportError = new Error('Something went wrong');
130
- beforeEach(() => {
131
- jest.mocked(log.error).mockImplementation(() => {
132
- throw reportError;
133
- });
134
- });
135
- test('logs failure', () => {
136
- const consoleErrorSpy = jest.spyOn(console, 'error').mockImplementation(jest.fn());
137
- subject();
138
- expect(consoleErrorSpy).toHaveBeenCalledWith('@log-service/onReject/failsafe', reportError);
139
- });
140
- });
141
- });
142
- describe('instrument', () => {
143
- let window;
144
- beforeEach(() => (window = {}));
145
- const subject = () => handler.instrument(window);
146
- test('installs "onError" handler', () => {
147
- subject();
148
- expect(window.onerror).toBe(handler.onError);
149
- });
150
- test('installs "onReject" handler', () => {
151
- subject();
152
- expect(window.onunhandledrejection).toBe(handler.onReject);
153
- });
154
- describe('with existing handler', () => {
155
- const existingHandler = jest.fn();
156
- beforeEach(() => (window.onerror = existingHandler));
157
- test('chains the error handlers', () => {
158
- const onErrorSpy = jest.spyOn(handler, 'onError');
159
- const error = new Error('Oops!');
160
- subject();
161
- window.onerror(error);
162
- expect(existingHandler).toHaveBeenCalledWith(error);
163
- expect(onErrorSpy).toHaveBeenCalledWith(error);
164
- });
165
- describe('when existing error handler is not a function', () => {
166
- beforeEach(() => (window.onerror = 'Nope!'));
167
- test('throws error', () => {
168
- expect(subject).toThrow(/attempt to instrument non-function value/i);
169
- });
170
- });
171
- });
172
- });
173
- });
174
- //# sourceMappingURL=global-error-handler.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"global-error-handler.test.js","sourceRoot":"","sources":["../../src/__tests__/global-error-handler.test.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,QAAQ,CAAC,iBAAiB,kBAAkB,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE;IACtD,MAAM,GAAG,GAAuB,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,EAAE,EAAE,CAAC;IACrD,IAAI,OAA2B,CAAC;IAEhC,SAAS,CAAC,GAAG,EAAE,CAAC,CAAC,OAAO,GAAG,IAAI,kBAAkB,CAAC,GAAU,CAAC,CAAC,CAAC,CAAC;IAEhE,UAAU,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;IAEvC,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE;QACrB,MAAM,IAAI,GAAG,EAAE,CAAC;QAChB,MAAM,MAAM,GAAG,EAAE,CAAC;QAClB,MAAM,GAAG,GAAG,oBAAoB,CAAC;QACjC,IAAI,OAAe,CAAC;QACpB,IAAI,KAAwB,CAAC;QAC7B,IAAI,WAAgC,CAAC;QAErC,UAAU,CAAC,GAAG,EAAE;YACZ,OAAO,GAAG,OAAO,CAAC;YAClB,KAAK,GAAG,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;YAC1C,WAAW,GAAG,SAAS,CAAC;QAC5B,CAAC,CAAC,CAAC;QAE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AAO,EAAE,SAAS,CAAC,CAAC;gBAClD,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;gBAEjC,OAAO,EAAE,CAAC;gBACV,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;gBAEtB,MAAM,CAAC,eAAe,CAAC,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;gBACpD,MAAM,CAAC,UAAU,CAAC,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;YACnD,CAAC,CAAC,CAAC;YAEH,QAAQ,CAAC,+CAA+C,EAAE,GAAG,EAAE;gBAC3D,UAAU,CAAC,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC;gBAE7C,IAAI,CAAC,cAAc,EAAE,GAAG,EAAE;oBACtB,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,2CAA2C,CAAC,CAAC;gBACzE,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=log-config-provider.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"log-config-provider.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/log-config-provider.test.tsx"],"names":[],"mappings":""}
@@ -1,20 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useDependencies } from '@servicetitan/react-ioc';
3
- import { render } from '@testing-library/react';
4
- import { LOG_CONFIG_TOKEN } from '../log-config';
5
- import { LogConfigProvider } from '../log-config-provider';
6
- describe(`[log-service] ${LogConfigProvider.name}`, () => {
7
- const logConfig = { endpoint: '/Log/Foo', storageKey: 'LogStorage_Foo' };
8
- let providedLogConfig;
9
- const Wrapper = () => {
10
- const [logConfig] = useDependencies(LOG_CONFIG_TOKEN);
11
- providedLogConfig = logConfig;
12
- return null;
13
- };
14
- const subject = () => render(_jsx(LogConfigProvider, { value: logConfig, children: _jsx(Wrapper, {}) }));
15
- test('provides LOG_CONFIG_TOKEN', () => {
16
- subject();
17
- expect(providedLogConfig).toBe(logConfig);
18
- });
19
- });
20
- //# sourceMappingURL=log-config-provider.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"log-config-provider.test.js","sourceRoot":"","sources":["../../src/__tests__/log-config-provider.test.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAGhD,OAAO,EAAE,gBAAgB,EAAa,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,QAAQ,CAAC,iBAAiB,iBAAiB,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE;IACrD,MAAM,SAAS,GAAc,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAC;IACpF,IAAI,iBAA4B,CAAC;IAEjC,MAAM,OAAO,GAAO,GAAG,EAAE;QACrB,MAAM,CAAC,SAAS,CAAC,GAAG,eAAe,CAAC,gBAAgB,CAAC,CAAC;QACtD,iBAAiB,GAAG,SAAS,CAAC;QAC9B,OAAO,IAAI,CAAC;IAChB,CAAC,CAAC;IAEF,MAAM,OAAO,GAAG,GAAG,EAAE,CACjB,MAAM,CACF,KAAC,iBAAiB,IAAC,KAAK,EAAE,SAAS,YAC/B,KAAC,OAAO,KAAG,GACK,CACvB,CAAC;IAEN,IAAI,CAAC,2BAA2B,EAAE,GAAG,EAAE;QACnC,OAAO,EAAE,CAAC;QAEV,MAAM,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=log-sender.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"log-sender.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/log-sender.test.ts"],"names":[],"mappings":""}
@@ -1,117 +0,0 @@
1
- import axios from 'axios';
2
- import { ConnectionService } from '../connection-service';
3
- import { LogEntryType } from '../log';
4
- import { lastId, LogStorage } from '../log-storage';
5
- import { LogSender } from '../log-sender';
6
- jest.mock('axios', () => ({ post: jest.fn() }));
7
- class MockLog {
8
- constructor(logStorage) {
9
- Object.defineProperty(this, "logStorage", {
10
- enumerable: true,
11
- configurable: true,
12
- writable: true,
13
- value: logStorage
14
- });
15
- }
16
- info(entry) {
17
- this.logStorage.store({
18
- type: LogEntryType.Info,
19
- ...entry,
20
- category: null,
21
- code: null,
22
- data: {},
23
- error: null,
24
- message: null,
25
- });
26
- }
27
- warning(_entry) { }
28
- }
29
- const SECOND = 1000;
30
- const MINUTE = 60 * SECOND;
31
- describe(`[log-service] ${LogSender.name}`, () => {
32
- const connectionService = new ConnectionService();
33
- const logConfig = { endpoint: '/Log/Foo', storageKey: 'LogStorage_Foo' };
34
- let logStorage;
35
- let log;
36
- beforeAll(() => {
37
- var _a;
38
- var _b;
39
- (_a = (_b = process.env).NODE_ENV) !== null && _a !== void 0 ? _a : (_b.NODE_ENV = 'test'); // workaround issue with Jest not setting NODE_ENV=test
40
- jest.spyOn(window, 'setInterval').mockImplementation(jest.fn());
41
- jest.spyOn(axios, 'post').mockImplementation(jest.fn());
42
- });
43
- beforeEach(() => {
44
- jest.clearAllMocks();
45
- logStorage = new LogStorage(logConfig);
46
- log = new MockLog(logStorage);
47
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
48
- const logSender = new LogSender(connectionService, logStorage, logConfig, log);
49
- });
50
- afterEach(() => logStorage.deleteToId(lastId(logStorage.items)));
51
- const subject = async () => {
52
- getHandler().fn();
53
- await Promise.resolve(); // resolve pending promises
54
- };
55
- function getHandler() {
56
- const [fn, interval] = jest.mocked(window.setInterval).mock.calls[0];
57
- return { fn, interval };
58
- }
59
- function initLog(count) {
60
- Array.from({ length: count }).map((_, index) => log.info({ message: `Message ${index}` }));
61
- return logStorage.items;
62
- }
63
- test('schedules handler to run once per minute', async () => {
64
- await subject();
65
- expect(getHandler().interval).toBe(MINUTE);
66
- });
67
- describe('when there are items waiting to be sent', () => {
68
- beforeEach(() => initLog(3));
69
- test('handler posts then purges log', async () => {
70
- const { items } = logStorage;
71
- await subject();
72
- expect(axios.post).toHaveBeenCalledWith(logConfig.endpoint, items);
73
- expect(logStorage.items).toEqual([]);
74
- });
75
- describe('when post fails', () => {
76
- beforeEach(() => jest.mocked(axios.post).mockRejectedValue(new Error('Oops!')));
77
- test('reschedules handler to run in exponentially increasing intervals until it succeeds', async () => {
78
- for (let n = 0; n <= 10; n++) {
79
- // eslint-disable-next-line no-await-in-loop
80
- await subject();
81
- }
82
- for (let n = 0; n < 10; n++) {
83
- expect(window.setInterval).toHaveBeenCalledWith(expect.any(Function), 2 ** n * SECOND);
84
- }
85
- jest.mocked(axios.post).mockReset();
86
- await subject();
87
- expect(logStorage.items).toEqual([]);
88
- expect(window.setInterval).toHaveBeenCalledWith(expect.any(Function), MINUTE);
89
- });
90
- });
91
- describe('when handler runs while posting', () => {
92
- beforeEach(() => jest.spyOn(axios, 'post').mockImplementation(() => {
93
- getHandler().fn();
94
- return Promise.resolve({});
95
- }));
96
- test('skips redundant post', async () => {
97
- await subject();
98
- expect(axios.post).toHaveBeenCalledTimes(1);
99
- });
100
- });
101
- describe('when offline', () => {
102
- beforeEach(() => connectionService.setOnline(false));
103
- afterEach(() => connectionService.setOnline(true));
104
- test('does not post', async () => {
105
- await subject();
106
- expect(axios.post).not.toHaveBeenCalled();
107
- });
108
- });
109
- });
110
- test('automatically posts when log >= 128 items', async () => {
111
- await subject();
112
- expect(axios.post).not.toHaveBeenCalled();
113
- const items = initLog(128);
114
- expect(axios.post).toHaveBeenCalledWith(logConfig.endpoint, items);
115
- });
116
- });
117
- //# source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AAG,EAAE;YAC1B,UAAU,CAAC,GAAG,EAAE,CAAC,iBAAiB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;YACrD,SAAS,CAAC,GAAG,EAAE,CAAC,iBAAiB,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;YAEnD,IAAI,CAAC,eAAe,EAAE,KAAK,IAAI,EAAE;gBAC7B,MAAM,OAAO,EAAE,CAAC;gBAEhB,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;YAC9C,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,2CAA2C,EAAE,KAAK,IAAI,EAAE;QACzD,MAAM,OAAO,EAAE,CAAC;QAChB,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;QAE1C,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QAE3B,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,oBAAoB,CAAC,SAAS,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=log-service.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"log-service.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/log-service.test.tsx"],"names":[],"mappings":""}
@@ -1,49 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Provider, useDependencies, useOptionalDependencies, } from '@servicetitan/react-ioc';
3
- import { render } from '@testing-library/react';
4
- import { LOG_CONFIG_TOKEN, LOG_PARENT_TOKEN, Log } from '../log';
5
- import { defaultLogConfig } from '../log-config';
6
- import { LogStorage } from '../log-storage';
7
- import { LogService } from '../log-service';
8
- describe(`[log-service] ${LogService.name}`, () => {
9
- let props;
10
- let providedLog;
11
- let providedLogConfig;
12
- let providedParent;
13
- let singletons;
14
- const Component = () => {
15
- [providedLog, providedLogConfig] = useDependencies(Log, LOG_CONFIG_TOKEN);
16
- [providedParent] = useOptionalDependencies(LOG_PARENT_TOKEN);
17
- return null;
18
- };
19
- const subject = () => {
20
- return render(_jsx(Provider, { singletons: singletons, children: _jsx(LogService, { ...props, children: _jsx(Component, {}) }) }));
21
- };
22
- test('provides Log instance', () => {
23
- subject();
24
- expect(providedLog).toBeInstanceOf(Log);
25
- });
26
- test('defaults to endpoint "/Log/Send" and storageKey "LogStorage"', () => {
27
- subject();
28
- expect(providedLogConfig).toEqual({ endpoint: '/Log/Send', storageKey: 'LogStorage' });
29
- });
30
- describe.each(['endpoint', 'storageKey'])('when "%s" is specified', prop => {
31
- beforeEach(() => (props = { [prop]: 'Foo' }));
32
- test(`uses the specified ${prop}`, () => {
33
- subject();
34
- expect(providedLogConfig[prop]).toEqual(props[prop]);
35
- });
36
- });
37
- describe('with a parent log', () => {
38
- const parent = new Log(new LogStorage(defaultLogConfig));
39
- beforeEach(() => {
40
- singletons = [{ provide: Log, useValue: parent }];
41
- props = { endpoint: '/Log/Foo', storageKey: 'LogStorage_Foo' };
42
- });
43
- test('provides parent Log', () => {
44
- subject();
45
- expect(providedParent).toBe(parent);
46
- });
47
- });
48
- });
49
- //# sourceMappingURL=log-service.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"log-service.test.js","sourceRoot":"","sources":["../../src/__tests__/log-service.test.tsx"],"names":[],"mappings":";AACA,OAAO,EACH,QAAQ,EAER,eAAe,EACf,uBAAuB,GAC1B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,GAAG,EAAa,MAAM,QAAQ,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,E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,CAAC,KAAK,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;QAE9C,IAAI,CAAC,sBAAsB,IAAI,EAAE,EAAE,GAAG,EAAE;YACpC,OAAO,EAAE,CAAC;YAEV,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;QACzD,CAAC,CAAC,CAAC;IACP,CAAC,CACJ,CAAC;IAEF,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;QAC/B,MAAM,MAAM,GAAQ,IAAI,GAAG,CAAC,IAAI,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC;QAE9D,UAAU,CAAC,GAAG,EAAE;YACZ,UAAU,GAAG,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;YAClD,KAAK,GAAG,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAC;QACnE,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,qBAAqB,EAAE,GAAG,EAAE;YAC7B,OAAO,EAAE,CAAC;YAEV,MAAM,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACxC,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=log-storage.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"log-storage.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/log-storage.test.ts"],"names":[],"mappings":""}
@@ -1,139 +0,0 @@
1
- import { LogEntryType } from '../log';
2
- import { lastId, LogStorage } from '../log-storage';
3
- import { MockBroadcastChannel } from './__mocks__';
4
- describe(`${LogStorage.name}`, () => {
5
- const LOCAL_STORAGE_VERSION = '1';
6
- const logConfig = { endpoint: '/Log/Foo', storageKey: 'LogStorage_Foo' };
7
- let logStorage;
8
- beforeAll(() => {
9
- jest.spyOn(globalThis, 'BroadcastChannel').mockImplementation((name) => new MockBroadcastChannel(name));
10
- });
11
- beforeEach(() => window.localStorage.clear());
12
- afterEach(() => logStorage.dispose());
13
- const subject = (entryOrEntries = []) => {
14
- logStorage = new LogStorage(logConfig);
15
- [entryOrEntries].flat().forEach(entry => logStorage.store(entry));
16
- return logStorage;
17
- };
18
- function itLoadsNoItems() {
19
- test('loads no items', () => {
20
- expect(subject().items).toEqual([]);
21
- });
22
- }
23
- itLoadsNoItems();
24
- describe('with previously saved items', () => {
25
- const entries = createEntries(3);
26
- beforeEach(() => {
27
- const logStorage = new LogStorage(logConfig);
28
- entries.map(entry => logStorage.store(entry));
29
- logStorage.dispose();
30
- });
31
- function itLoadsSavedItems() {
32
- test('loads saved items', () => {
33
- expect(subject().items).toEqual(buildItems(entries).map(expect.objectContaining));
34
- });
35
- }
36
- itLoadsSavedItems();
37
- describe('when saved data has incompatible version', () => {
38
- const storageVersionKey = `${logConfig.storageKey}Version`;
39
- beforeEach(() => window.localStorage.setItem(storageVersionKey, '-1'));
40
- itLoadsNoItems();
41
- test('updates version', () => {
42
- subject();
43
- expect(localStorage.getItem(storageVersionKey)).toBe(LOCAL_STORAGE_VERSION);
44
- });
45
- });
46
- describe('when saved data is not valid', () => {
47
- beforeEach(() => {
48
- window.localStorage.setItem(logConfig.storageKey, '}{');
49
- });
50
- itLoadsNoItems();
51
- });
52
- describe('when saved data contains old "error" field', () => {
53
- beforeEach(() => {
54
- const itemsWithErrorField = JSON.parse(localStorage.getItem(logConfig.storageKey)).map(({ exception, ...rest }) => ({ ...rest, error: exception }));
55
- localStorage.setItem(logConfig.storageKey, JSON.stringify(itemsWithErrorField));
56
- });
57
- itLoadsSavedItems();
58
- });
59
- describe('when multiple instances are running simultaneously', () => {
60
- let otherLogStorage;
61
- beforeEach(() => (otherLogStorage = new LogStorage(logConfig)));
62
- afterEach(() => otherLogStorage.dispose());
63
- test('deleteToId removes items from both instances', () => {
64
- const logStorage = subject();
65
- expect(logStorage.items.length).toEqual(entries.length);
66
- expect(otherLogStorage.items.length).toEqual(entries.length);
67
- logStorage.deleteToId(lastId(logStorage.items));
68
- expect(logStorage.items).toEqual([]);
69
- expect(otherLogStorage.items).toEqual([]);
70
- });
71
- test('deleteToId does not remove private items', () => {
72
- const logStorage = subject();
73
- const entry = createEntry({ message: 'foo' });
74
- otherLogStorage.store(entry);
75
- logStorage.deleteToId(lastId(logStorage.items));
76
- expect(logStorage.items).toEqual([]);
77
- expect(otherLogStorage.items).toEqual(buildItems([entry]).map(expect.objectContaining));
78
- });
79
- });
80
- });
81
- test('stores items with unique ids', () => {
82
- const entries = createEntries(3);
83
- const logStorage = subject(entries);
84
- expect(logStorage.items).toEqual(buildItems(entries).map(expect.objectContaining));
85
- expect(new Set(logStorage.items.map(({ id }) => id)).size).toBe(entries.length);
86
- });
87
- test('limits storage to 1000 items', () => {
88
- const logStorage = subject(createEntries(1001));
89
- expect(logStorage.items).toHaveLength(1000);
90
- });
91
- test('stringifies entry data', () => {
92
- const entry = createEntry({ message: 'foo', data: { foo: 'bar' } });
93
- const { data } = subject(entry).items[0];
94
- expect(data).toBe(JSON.stringify(entry.data));
95
- });
96
- test('converts entry error to exception', () => {
97
- const error = new Error('Oops!');
98
- const { exception } = subject(createEntry({ error })).items[0];
99
- expect(exception).toEqual(JSON.stringify({ message: error.message, stack: error.stack }));
100
- });
101
- test('deleteToId removes entries with same or lower id', () => {
102
- const entries = createEntries(10);
103
- const logStorage = subject(entries);
104
- const index = 2;
105
- const { id } = logStorage.items[index];
106
- logStorage.deleteToId(id);
107
- expect(logStorage.items.length).toBe(entries.length - index - 1);
108
- expect(logStorage.items.every(entry => entry.id > id)).toBe(true);
109
- });
110
- test('loadBatch returns first N items', () => {
111
- const entries = createEntries(10);
112
- const logStorage = subject(entries);
113
- const count = 5;
114
- const batch = logStorage.loadBatch(count);
115
- expect(batch).toEqual(buildItems(entries.slice(0, count)).map(expect.objectContaining));
116
- });
117
- });
118
- function buildItems(entries) {
119
- return entries.map(({ data, error, ...rest }) => ({
120
- ...rest,
121
- data: JSON.stringify(data),
122
- exception: JSON.stringify(error && { message: error.message, stack: error.stack }),
123
- }));
124
- }
125
- function createEntries(length) {
126
- return Array.from({ length }).map((_, index) => createEntry({ message: `Entry ${index}` }));
127
- }
128
- function createEntry(entry) {
129
- return {
130
- type: LogEntryType.Info,
131
- message: null,
132
- code: null,
133
- category: null,
134
- error: null,
135
- data: {},
136
- ...entry,
137
- };
138
- }
139
- //# sourceMappingURL=log-storage.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"log-storage.test.js","sourceRoot":"","sources":["../../src/__tests__/log-storage.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,YAAY,EAAE,MAAM,QAAQ,CAAC;AAErD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,QAAQ,CAAC,GAAG,UAAU,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE;IAChC,MAAM,qBAAqB,GAAG,GAAG,CAAC;IAClC,MAAM,SAAS,GAAc,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAC;IACpF,IAAI,UAAsB,CAAC;IAE3B,SAAS,CAAC,GAAG,EAAE;QACX,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,kBAAkB,CAAC,CAAC,kBAAkB,CACzD,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,oBAAoB,CAAC,IAAI,CAAC,CACnD,CAAC;IACN,CAAC,CAAC,CAAC;IAEH,UAAU,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC,CAAC;IAC9C,SAAS,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC;I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","sources":["../../src/__tests__/log.test.ts"],"names":[],"mappings":""}