Skip to content

Commit d8a6654

Browse files
committed
Update copyright header with ASLv2 info
1 parent 538c69f commit d8a6654

File tree

2 files changed

+39
-4
lines changed

2 files changed

+39
-4
lines changed

Diff for: lib/sse.js

+15
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
/**
2+
* sse.js - A flexible EventSource polyfill/replacement.
3+
* https://github.com/mpetazzoni/sse.js
4+
*
25
* Copyright (C) 2016-2024 Maxime Petazzoni <[email protected]>.
36
* All rights reserved.
7+
*
8+
* Licensed under the Apache License, Version 2.0 (the "License");
9+
* you may not use this file except in compliance with the License.
10+
* You may obtain a copy of the License at
11+
*
12+
* http://www.apache.org/licenses/LICENSE-2.0
13+
*
14+
* Unless required by applicable law or agreed to in writing, software
15+
* distributed under the License is distributed on an "AS IS" BASIS,
16+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
* See the License for the specific language governing permissions and
18+
* limitations under the License.
419
*/
520

621

Diff for: lib/sse.test.js

+24-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
/**
2+
* sse.js - A flexible EventSource polyfill/replacement.
3+
* https://github.com/mpetazzoni/sse.js
4+
*
5+
* Copyright (C) 2016-2024 Maxime Petazzoni <[email protected]>.
6+
* All rights reserved.
7+
*
8+
* Licensed under the Apache License, Version 2.0 (the "License");
9+
* you may not use this file except in compliance with the License.
10+
* You may obtain a copy of the License at
11+
*
12+
* http://www.apache.org/licenses/LICENSE-2.0
13+
*
14+
* Unless required by applicable law or agreed to in writing, software
15+
* distributed under the License is distributed on an "AS IS" BASIS,
16+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
* See the License for the specific language governing permissions and
18+
* limitations under the License.
19+
*/
20+
121
import { SSE } from 'sse.js';
222

323
// Setup Mocking for XMLHttpRequest
@@ -32,7 +52,7 @@ beforeEach(() => {
3252

3353

3454
describe('SSE Initialization', () => {
35-
55+
3656
it('should initialize with default options', () => {
3757
const sse = new SSE('http://example.com');
3858
expect(sse.method).toBe('GET');
@@ -164,7 +184,7 @@ describe('SSE Event handling and Listeners', () => {
164184
expect(listener.mock.calls[0][0].event).toBe(undefined);
165185
expect(listener.mock.calls[0][0].id).toBe('1');
166186
expect(listener.mock.calls[0][0].lastEventId).toBe('1');
167-
})
187+
})
168188

169189
it('should handle multiple data events', () => {
170190
sse.xhr.responseText = 'id: id1\ndata: First message\n\n';
@@ -237,7 +257,7 @@ describe('SSE Event handling and Listeners', () => {
237257
expect(listener.mock.calls[0][0].data).toBe('Test message\nmore message');
238258
expect(listener.mock.calls[0][0].event).toBe(undefined);
239259
expect(listener.mock.calls[0][0].id).toBe(null);
240-
})
260+
})
241261

242262
it('should handle an event with a custom event type', () => {
243263
sse.xhr.responseText = 'event: customEvent\ndata: Custom event data\n\n';
@@ -250,7 +270,7 @@ describe('SSE Event handling and Listeners', () => {
250270
expect(customListener.mock.calls[0][0].type).toBe('customEvent');
251271
expect(customListener.mock.calls[0][0].id).toBe(null);
252272
});
253-
273+
254274
it('should handle events different field orders', () => {
255275
sse.xhr.responseText = 'data: Custom event data\nevent: customEvent\nid: 1\n\n';
256276
sse.xhr.trigger('progress', {});

0 commit comments

Comments
 (0)