chore: tests

This commit is contained in:
shirakaba
2022-11-23 01:40:29 +09:00
parent 7a276df09c
commit 832595281f
6 changed files with 372 additions and 22 deletions

View File

@@ -11,6 +11,16 @@ const timeOrigin = Date.now();
const emptyArray = [] as const;
export class DOMEvent {
/**
* @private
* Internal API to facilitate testing - to be removed once we've completed
* the breaking changes to migrate fully to DOMEvents.
*
* Gets the last event to be dispatched, allowing you to access the DOM
* Event that corresponds to the currently-running callback.
*/
static unstable_currentEvent: DOMEvent | null = null;
readonly NONE = 0;
readonly CAPTURING_PHASE = 1;
readonly AT_TARGET = 2;
@@ -216,6 +226,10 @@ export class DOMEvent {
this.target = target;
this._canceled = false;
// Internal API to facilitate testing - to be removed once we've
// completed the breaking changes to migrate fully to DOMEvents.
DOMEvent.unstable_currentEvent = this;
/**
* Resets any internal state to allow the event to be redispatched. Call
* this before returning.

View File

@@ -77,6 +77,7 @@ export declare const Connectivity: {
};
export * from './core-types';
export { CSSUtils } from './css/system-classes';
export { DOMEvent } from './data/dom-events/dom-event';
export { ObservableArray, ChangeType } from './data/observable-array';
export type { ChangedData } from './data/observable-array';
export { Observable, WrappedValue, fromObject, fromObjectRecursive } from './data/observable';

View File

@@ -97,6 +97,7 @@ export * from './core-types';
export { CSSUtils } from './css/system-classes';
export { DOMEvent } from './data/dom-events/dom-event';
export { ObservableArray, ChangeType } from './data/observable-array';
export type { ChangedData } from './data/observable-array';
export { Observable, WrappedValue, fromObject, fromObjectRecursive } from './data/observable';