|
1 | | -import { beforeEach, describe, it } from '@std/testing/bdd'; |
| 1 | +import { beforeEach, describe, it } from "@std/testing/bdd"; |
2 | 2 | import { expect } from "@std/expect"; |
3 | 3 | import { JSDOM } from "jsdom"; |
4 | | -import { Symbol } from "@effection/core"; |
5 | 4 |
|
6 | | -import { globals, setDocumentResolver, addInteractionWrapper, setInteractorTimeout } from "../mod.ts"; |
| 5 | +import { globals, setDocumentResolver, setInteractorTimeout } from "../mod.ts"; |
7 | 6 |
|
8 | 7 | function makeDocument(body = ""): Document { |
9 | | - return new JSDOM(`<!doctype html><html><body>${body}</body></html>`).window.document; |
| 8 | + return new JSDOM(`<!doctype html><html><body>${body}</body></html>`).window |
| 9 | + .document; |
10 | 10 | } |
11 | 11 |
|
12 | 12 | describe("@interactors/globals", () => { |
@@ -34,58 +34,4 @@ describe("@interactors/globals", () => { |
34 | 34 | expect(globals.interactorTimeout).toEqual(3000); |
35 | 35 | }); |
36 | 36 | }); |
37 | | - |
38 | | - describe("wrapInteraction", () => { |
39 | | - it("returns the same interaction without any change", () => { |
40 | | - let action = async () => {}; |
41 | | - expect( |
42 | | - (globals.wrapInteraction( |
43 | | - action, |
44 | | - { |
45 | | - type: "action", |
46 | | - interactor: "Interactor", |
47 | | - description: "plain action", |
48 | | - action, |
49 | | - code: () => "", |
50 | | - halt: () => Promise.resolve(), |
51 | | - options: { |
52 | | - interactor: "Interactor", |
53 | | - name: "plain", |
54 | | - type: "action", |
55 | | - code: () => "", |
56 | | - args: [], |
57 | | - }, |
58 | | - [Symbol.operation]: Promise.resolve(), |
59 | | - } |
60 | | - ) as () => unknown)() |
61 | | - ).toBe(action); |
62 | | - }); |
63 | | - |
64 | | - it("applies defined interaction wrapper", () => { |
65 | | - let action = async () => await Promise.resolve("foo"); |
66 | | - let removeWrapper = addInteractionWrapper(() => async () => await Promise.resolve("bar")); |
67 | | - globals.wrapInteraction( |
68 | | - action, |
69 | | - { |
70 | | - type: "action", |
71 | | - interactor: "Interactor", |
72 | | - description: "foo action", |
73 | | - action, |
74 | | - code: () => "", |
75 | | - halt: () => Promise.resolve(), |
76 | | - options: { |
77 | | - interactor: "Interactor", |
78 | | - name: "foo", |
79 | | - type: "action", |
80 | | - code: () => "", |
81 | | - args: [], |
82 | | - }, |
83 | | - [Symbol.operation]: Promise.resolve(), |
84 | | - }, |
85 | | - ); |
86 | | - |
87 | | - removeWrapper(); |
88 | | - expect(globals.interactionWrappers.has(action)).toEqual(false); |
89 | | - }); |
90 | | - }); |
91 | 37 | }); |
0 commit comments