Updated to airbnb coding styles

This commit is contained in:
Alejandro Celaya
2022-03-26 12:17:42 +01:00
parent 4e9b19afd1
commit a2df486280
239 changed files with 2210 additions and 3549 deletions

View File

@@ -14,13 +14,13 @@ describe('helpers', () => {
const onTokenExpired = jest.fn();
it.each([
[ Mock.of<MercureInfo>({ loading: true, error: false, mercureHubUrl: 'foo' }) ],
[ Mock.of<MercureInfo>({ loading: false, error: true, mercureHubUrl: 'foo' }) ],
[ Mock.of<MercureInfo>({ loading: true, error: true, mercureHubUrl: 'foo' }) ],
[ Mock.of<MercureInfo>({ loading: false, error: false, mercureHubUrl: undefined }) ],
[ Mock.of<MercureInfo>({ loading: true, error: true, mercureHubUrl: undefined }) ],
[Mock.of<MercureInfo>({ loading: true, error: false, mercureHubUrl: 'foo' })],
[Mock.of<MercureInfo>({ loading: false, error: true, mercureHubUrl: 'foo' })],
[Mock.of<MercureInfo>({ loading: true, error: true, mercureHubUrl: 'foo' })],
[Mock.of<MercureInfo>({ loading: false, error: false, mercureHubUrl: undefined })],
[Mock.of<MercureInfo>({ loading: true, error: true, mercureHubUrl: undefined })],
])('does not bind an EventSource when loading, error or no hub URL', (mercureInfo) => {
bindToMercureTopic(mercureInfo, [ '' ], identity, () => {});
bindToMercureTopic(mercureInfo, [''], identity, () => {});
expect(EventSourcePolyfill).not.toHaveBeenCalled();
expect(onMessage).not.toHaveBeenCalled();
@@ -40,7 +40,7 @@ describe('helpers', () => {
error: false,
mercureHubUrl,
token,
}, [ topic ], onMessage, onTokenExpired);
}, [topic], onMessage, onTokenExpired);
expect(EventSourcePolyfill).toHaveBeenCalledWith(hubUrl, {
headers: {
@@ -48,7 +48,7 @@ describe('helpers', () => {
},
});
const [ es ] = (EventSourcePolyfill as any).mock.instances as EventSourcePolyfill[];
const [es] = (EventSourcePolyfill as any).mock.instances as EventSourcePolyfill[];
es.onmessage?.({ data: '{"foo": "bar"}' });
es.onerror?.({ status: 401 });