@whatwg-node/events 0.1.0 → 0.1.1-alpha-20230525101758-552afdd
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.
- package/CHANGELOG.md +8 -0
- package/dist/node-ponyfill.js +1 -1
- package/package.json +1 -1
- package/tests/events.spec.ts +8 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @whatwg-node/events
|
|
2
2
|
|
|
3
|
+
## 0.1.1-alpha-20230525101758-552afdd
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#554](https://github.com/ardatan/whatwg-node/pull/554)
|
|
8
|
+
[`552afdd`](https://github.com/ardatan/whatwg-node/commit/552afdd156de29d1f0bb3f2d172e3189c4dd7c6f)
|
|
9
|
+
Thanks [@n1ru4l](https://github.com/n1ru4l)! - Follow the spec and set `detail` to null by default
|
|
10
|
+
|
|
3
11
|
## 0.1.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
package/dist/node-ponyfill.js
CHANGED
package/package.json
CHANGED
package/tests/events.spec.ts
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import { CustomEvent } from '@whatwg-node/events';
|
|
2
2
|
|
|
3
3
|
describe('CustomEvent', () => {
|
|
4
|
-
it('detail', () => {
|
|
4
|
+
it('detail should be set', () => {
|
|
5
5
|
const target = new EventTarget();
|
|
6
6
|
const listener = jest.fn();
|
|
7
7
|
target.addEventListener('test', listener);
|
|
8
8
|
target.dispatchEvent(new CustomEvent('test', { detail: 123 }));
|
|
9
9
|
expect(listener).toHaveBeenCalledWith(expect.objectContaining({ detail: 123 }));
|
|
10
10
|
});
|
|
11
|
+
it('detail should be null by default', () => {
|
|
12
|
+
const target = new EventTarget();
|
|
13
|
+
const listener = jest.fn();
|
|
14
|
+
target.addEventListener('test', listener);
|
|
15
|
+
target.dispatchEvent(new CustomEvent('test'));
|
|
16
|
+
expect(listener).toHaveBeenCalledWith(expect.objectContaining({ detail: null }));
|
|
17
|
+
})
|
|
11
18
|
});
|