@magnit-ce/code-tests 0.0.1
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/LICENSE +121 -0
- package/README.md +89 -0
- package/dist/code-tests.cjs +999 -0
- package/dist/code-tests.d.cts +36 -0
- package/dist/code-tests.d.ts +36 -0
- package/dist/code-tests.js +966 -0
- package/dist/code-tests.min.js +396 -0
- package/package.json +44 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
declare class TestPromise<T> extends Promise<T> {
|
|
2
|
+
toBeDefined(valueName?: string): Promise<void>;
|
|
3
|
+
toBe(value: any, exact?: boolean): Promise<void>;
|
|
4
|
+
toContainText(value: string): Promise<void>;
|
|
5
|
+
toHaveAttribute(value: string): Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
declare const BEFOREALL: unique symbol;
|
|
8
|
+
declare const BEFOREEACH: unique symbol;
|
|
9
|
+
declare const AFTERALL: unique symbol;
|
|
10
|
+
declare const AFTEREACH: unique symbol;
|
|
11
|
+
declare class CodeTests {
|
|
12
|
+
#private;
|
|
13
|
+
static timeoutMS: number;
|
|
14
|
+
static expect<T>(value: T): TestPromise<T>;
|
|
15
|
+
static expectSync<T>(value: T): TestPromise<T>;
|
|
16
|
+
static expectBefore<T>(value: T): TestPromise<T>;
|
|
17
|
+
}
|
|
18
|
+
declare function expect(value: any): TestPromise<any>;
|
|
19
|
+
|
|
20
|
+
type CodeTestsProperties = {};
|
|
21
|
+
declare class CodeTestsElement extends HTMLElement {
|
|
22
|
+
#private;
|
|
23
|
+
componentParts: Map<string, HTMLElement>;
|
|
24
|
+
getElement<T extends HTMLElement = HTMLElement>(id: string): T;
|
|
25
|
+
findElement<T extends HTMLElement = HTMLElement>(id: string): T;
|
|
26
|
+
constructor();
|
|
27
|
+
connectedCallback(): void;
|
|
28
|
+
disconnectedCallback(): void;
|
|
29
|
+
loadTests(path: string): Promise<void>;
|
|
30
|
+
runTests(): Promise<void>;
|
|
31
|
+
static create(properties: CodeTestsProperties): HTMLElement;
|
|
32
|
+
static observedAttributes: string[];
|
|
33
|
+
attributeChangedCallback(attributeName: string, oldValue: string, newValue: string): void;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { AFTERALL, AFTEREACH, BEFOREALL, BEFOREEACH, CodeTests, CodeTestsElement, type CodeTestsProperties, expect };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
declare class TestPromise<T> extends Promise<T> {
|
|
2
|
+
toBeDefined(valueName?: string): Promise<void>;
|
|
3
|
+
toBe(value: any, exact?: boolean): Promise<void>;
|
|
4
|
+
toContainText(value: string): Promise<void>;
|
|
5
|
+
toHaveAttribute(value: string): Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
declare const BEFOREALL: unique symbol;
|
|
8
|
+
declare const BEFOREEACH: unique symbol;
|
|
9
|
+
declare const AFTERALL: unique symbol;
|
|
10
|
+
declare const AFTEREACH: unique symbol;
|
|
11
|
+
declare class CodeTests {
|
|
12
|
+
#private;
|
|
13
|
+
static timeoutMS: number;
|
|
14
|
+
static expect<T>(value: T): TestPromise<T>;
|
|
15
|
+
static expectSync<T>(value: T): TestPromise<T>;
|
|
16
|
+
static expectBefore<T>(value: T): TestPromise<T>;
|
|
17
|
+
}
|
|
18
|
+
declare function expect(value: any): TestPromise<any>;
|
|
19
|
+
|
|
20
|
+
type CodeTestsProperties = {};
|
|
21
|
+
declare class CodeTestsElement extends HTMLElement {
|
|
22
|
+
#private;
|
|
23
|
+
componentParts: Map<string, HTMLElement>;
|
|
24
|
+
getElement<T extends HTMLElement = HTMLElement>(id: string): T;
|
|
25
|
+
findElement<T extends HTMLElement = HTMLElement>(id: string): T;
|
|
26
|
+
constructor();
|
|
27
|
+
connectedCallback(): void;
|
|
28
|
+
disconnectedCallback(): void;
|
|
29
|
+
loadTests(path: string): Promise<void>;
|
|
30
|
+
runTests(): Promise<void>;
|
|
31
|
+
static create(properties: CodeTestsProperties): HTMLElement;
|
|
32
|
+
static observedAttributes: string[];
|
|
33
|
+
attributeChangedCallback(attributeName: string, oldValue: string, newValue: string): void;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { AFTERALL, AFTEREACH, BEFOREALL, BEFOREEACH, CodeTests, CodeTestsElement, type CodeTestsProperties, expect };
|