@effect-uai/slack 0.18.0 → 0.19.0-dev-20261109183959
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/README.md +1 -1
- package/dist/internal/socket.test.mjs +50 -31
- package/dist/internal/socket.test.mjs.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -8,6 +8,7 @@ import * as Cause$1 from "effect/Cause";
|
|
|
8
8
|
import * as Duration$1 from "effect/Duration";
|
|
9
9
|
import * as Effect$1 from "effect/Effect";
|
|
10
10
|
import * as Exit$1 from "effect/Exit";
|
|
11
|
+
import "effect/Fiber";
|
|
11
12
|
import { constVoid, flow, pipe } from "effect/Function";
|
|
12
13
|
import * as Layer$1 from "effect/Layer";
|
|
13
14
|
import * as Schedule from "effect/Schedule";
|
|
@@ -15,30 +16,31 @@ import * as Scope$1 from "effect/Scope";
|
|
|
15
16
|
import * as TestClock from "effect/testing/TestClock";
|
|
16
17
|
import * as TestConsole from "effect/testing/TestConsole";
|
|
17
18
|
import * as FakeWebSocket from "@effect-uai/core/testing/FakeWebSocket";
|
|
18
|
-
//#region ../../../node_modules/.pnpm/@effect+vitest@4.
|
|
19
|
+
//#region ../../../node_modules/.pnpm/@effect+vitest@4.1.2_effect@4.1.2_vitest@5.0.3_@types+node@26.2.0_vite@7.3.2_@types+nod_a2fffe0deec250ef9d6207b86a9a1ab8/node_modules/@effect/vitest/dist/internal/internal.js
|
|
19
20
|
/**
|
|
20
21
|
* @since 4.0.0
|
|
21
22
|
*/
|
|
22
23
|
const getCurrentSuite = TestRunner.getCurrentSuite;
|
|
23
|
-
const runPromise =
|
|
24
|
-
const exit = yield* Effect$1.exit(effect);
|
|
24
|
+
const runPromise = (effect, ctx) => Effect$1.runPromise(Effect$1.uninterruptibleMask((restore) => Effect$1.gen(function* () {
|
|
25
|
+
const exit = yield* Effect$1.exit(restore(effect));
|
|
25
26
|
if (Exit$1.isFailure(exit)) {
|
|
26
27
|
const errors = Cause$1.prettyErrors(exit.cause);
|
|
27
28
|
for (let i = 0; i < errors.length; i++) yield* Effect$1.logError(errors[i]);
|
|
28
29
|
}
|
|
29
30
|
return yield* exit;
|
|
30
|
-
}
|
|
31
|
+
})), { signal: ctx?.signal });
|
|
32
|
+
const settleOnAbort = (ctx, promise) => {
|
|
33
|
+
const onAbort = () => ctx.onTestFinished(() => promise.then(constVoid, constVoid));
|
|
34
|
+
ctx.signal.addEventListener("abort", onAbort, { once: true });
|
|
35
|
+
const cleanup = () => ctx.signal.removeEventListener("abort", onAbort);
|
|
36
|
+
promise.then(cleanup, cleanup);
|
|
37
|
+
if (ctx.signal.aborted) onAbort();
|
|
38
|
+
return promise;
|
|
39
|
+
};
|
|
31
40
|
/** @internal */
|
|
32
41
|
const runTest = (ctx) => (effect) => {
|
|
33
42
|
const promise = runPromise(effect, ctx);
|
|
34
|
-
|
|
35
|
-
const onAbort = () => ctx.onTestFinished(() => promise.then(constVoid, constVoid));
|
|
36
|
-
ctx.signal.addEventListener("abort", onAbort, { once: true });
|
|
37
|
-
const cleanup = () => ctx.signal.removeEventListener("abort", onAbort);
|
|
38
|
-
promise.then(cleanup, cleanup);
|
|
39
|
-
if (ctx.signal.aborted) onAbort();
|
|
40
|
-
}
|
|
41
|
-
return promise;
|
|
43
|
+
return ctx ? settleOnAbort(ctx, promise) : promise;
|
|
42
44
|
};
|
|
43
45
|
const TestEnv = /*#__PURE__*/ Layer$1.mergeAll(TestConsole.layer, /*#__PURE__*/ TestClock.layer());
|
|
44
46
|
/** @internal */
|
|
@@ -74,6 +76,9 @@ const collectTasks = (tasks, acc = []) => {
|
|
|
74
76
|
}
|
|
75
77
|
return acc;
|
|
76
78
|
};
|
|
79
|
+
const runsMoreThanOnce = (task) => {
|
|
80
|
+
return ((typeof task.retry === "number" ? task.retry : task.retry?.count) ?? 0) > 0 || (task.repeats ?? 0) > 0;
|
|
81
|
+
};
|
|
77
82
|
const registerProp = (it, name, arbitraries, property, timeout) => {
|
|
78
83
|
const arbitrary = makeArbitrary(arbitraries);
|
|
79
84
|
it(name, testOptions(timeout), withFixturesOf(() => {}, (ctx) => runCheck(ctx, arbitrary, (values) => property(values, ctx), checkOptions(timeout))));
|
|
@@ -93,11 +98,35 @@ const makeTester = (mapEffect, it) => {
|
|
|
93
98
|
prop
|
|
94
99
|
});
|
|
95
100
|
};
|
|
96
|
-
const makeProp = (it) => (name, arbitraries, self, timeout) => registerProp(it, name, arbitraries, (values, ctx) =>
|
|
101
|
+
const makeProp = (it) => (name, arbitraries, self, timeout) => registerProp(it, name, arbitraries, (values, ctx) => {
|
|
102
|
+
const result = self(values, ctx);
|
|
103
|
+
if (result !== void 0 && typeof result !== "boolean") throw new TypeError("it.prop callbacks must return boolean or void. Use it.effect.prop for Effect callbacks.");
|
|
104
|
+
return result !== false;
|
|
105
|
+
}, timeout);
|
|
97
106
|
const makeLayer = (it) => (layer_, options) => (...args) => {
|
|
98
107
|
const excludeTestServices = options?.excludeTestServices ?? false;
|
|
99
108
|
const withTestEnv = excludeTestServices ? layer_ : Layer$1.provideMerge(layer_, TestEnv);
|
|
100
109
|
const memoMap = options?.memoMap ?? Effect$1.runSync(Layer$1.makeMemoMap);
|
|
110
|
+
const buildPerTest = options?.buildPerTest ?? false;
|
|
111
|
+
const suiteOptions = options?.concurrent === void 0 ? {} : { concurrent: options.concurrent };
|
|
112
|
+
const makeBlockMethods = (provide) => makeItProxy(it, {
|
|
113
|
+
effect: makeTester((effect) => provide(Effect$1.scoped(effect)), it),
|
|
114
|
+
prop: makeProp(it),
|
|
115
|
+
flakyTest,
|
|
116
|
+
layer(nestedLayer, nestedOptions) {
|
|
117
|
+
return makeLayer(it)(Layer$1.provideMerge(nestedLayer, withTestEnv), {
|
|
118
|
+
...nestedOptions,
|
|
119
|
+
memoMap: Layer$1.forkMemoMapUnsafe(memoMap),
|
|
120
|
+
excludeTestServices,
|
|
121
|
+
buildPerTest: buildPerTest || nestedOptions?.buildPerTest === true
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
if (buildPerTest) {
|
|
126
|
+
const methods = makeBlockMethods((effect) => Effect$1.scopedWith((scope) => Layer$1.buildWithMemoMap(withTestEnv, Layer$1.forkMemoMapUnsafe(memoMap), scope).pipe(Effect$1.orDie, Effect$1.flatMap((context) => Effect$1.provide(effect, context)))));
|
|
127
|
+
if (args.length === 1) return args[0](methods);
|
|
128
|
+
return describe(args[0], suiteOptions, () => args[1](methods));
|
|
129
|
+
}
|
|
101
130
|
const scope = Effect$1.runSync(Scope$1.make());
|
|
102
131
|
const contextEffect = Layer$1.buildWithMemoMap(withTestEnv, memoMap, scope).pipe(Effect$1.orDie, Effect$1.cached, Effect$1.runSync);
|
|
103
132
|
let closed = false;
|
|
@@ -106,18 +135,7 @@ const makeLayer = (it) => (layer_, options) => (...args) => {
|
|
|
106
135
|
closed = true;
|
|
107
136
|
return runPromise(Scope$1.close(scope, Exit$1.void));
|
|
108
137
|
};
|
|
109
|
-
const methods =
|
|
110
|
-
effect: makeTester((effect) => Effect$1.flatMap(contextEffect, (context) => effect.pipe(Effect$1.scoped, Effect$1.provide(context))), it),
|
|
111
|
-
prop: makeProp(it),
|
|
112
|
-
flakyTest,
|
|
113
|
-
layer(nestedLayer, options) {
|
|
114
|
-
return makeLayer(it)(Layer$1.provideMerge(nestedLayer, withTestEnv), {
|
|
115
|
-
...options,
|
|
116
|
-
memoMap: Layer$1.forkMemoMapUnsafe(memoMap),
|
|
117
|
-
excludeTestServices
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
});
|
|
138
|
+
const methods = makeBlockMethods((effect) => Effect$1.flatMap(contextEffect, (context) => Effect$1.provide(effect, context)));
|
|
121
139
|
if (args.length === 1) {
|
|
122
140
|
const currentSuite = getCurrentSuite();
|
|
123
141
|
const previousTasks = new Set(currentSuite.tasks);
|
|
@@ -128,10 +146,11 @@ const makeLayer = (it) => (layer_, options) => (...args) => {
|
|
|
128
146
|
return;
|
|
129
147
|
}
|
|
130
148
|
const blockTaskSet = new Set(blockTasks);
|
|
149
|
+
const releaseAfterLastTest = !blockTasks.some(runsMoreThanOnce);
|
|
131
150
|
let remaining = blockTasks.length;
|
|
132
151
|
beforeEach(({ onTestFinished, signal, task }) => {
|
|
133
152
|
if (!blockTaskSet.has(task)) return;
|
|
134
|
-
onTestFinished(() => {
|
|
153
|
+
if (releaseAfterLastTest) onTestFinished(() => {
|
|
135
154
|
remaining--;
|
|
136
155
|
if (remaining === 0) return closeScope();
|
|
137
156
|
});
|
|
@@ -140,7 +159,6 @@ const makeLayer = (it) => (layer_, options) => (...args) => {
|
|
|
140
159
|
afterAll(() => closeScope(), hookTimeout(options?.timeout));
|
|
141
160
|
return;
|
|
142
161
|
}
|
|
143
|
-
const suiteOptions = options?.concurrent === void 0 ? {} : { concurrent: options.concurrent };
|
|
144
162
|
return describe(args[0], suiteOptions, () => {
|
|
145
163
|
beforeAll(() => runPromise(Effect$1.asVoid(contextEffect)), hookTimeout(options?.timeout));
|
|
146
164
|
afterAll(() => closeScope(), hookTimeout(options?.timeout));
|
|
@@ -162,11 +180,12 @@ const it$1 = /*#__PURE__*/ makeMethods(it$2);
|
|
|
162
180
|
/** @internal */
|
|
163
181
|
const { effect, layer, live, prop } = it$1;
|
|
164
182
|
//#endregion
|
|
165
|
-
//#region ../../../node_modules/.pnpm/@effect+vitest@4.
|
|
166
|
-
/**
|
|
167
|
-
* @since 4.0.0
|
|
168
|
-
*/
|
|
183
|
+
//#region ../../../node_modules/.pnpm/@effect+vitest@4.1.2_effect@4.1.2_vitest@5.0.3_@types+node@26.2.0_vite@7.3.2_@types+nod_a2fffe0deec250ef9d6207b86a9a1ab8/node_modules/@effect/vitest/dist/index.js
|
|
169
184
|
/**
|
|
185
|
+
* Vitest test API extended with Effect test helpers.
|
|
186
|
+
*
|
|
187
|
+
* @stability unstable
|
|
188
|
+
* @category testing
|
|
170
189
|
* @since 4.0.0
|
|
171
190
|
*/
|
|
172
191
|
const it = it$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"socket.test.mjs","names":["Effect","Exit","Cause","Duration","Layer","Scope","V.describe","it","V.it","internal.it"],"sources":["../../../../../node_modules/.pnpm/@effect+vitest@4.0.1_effect@4.0.1_vitest@5.0.3_@types+node@26.2.0_vite@7.3.2_@types+nod_65816e3353e20bfeb9b2e1494bdddeef/node_modules/@effect/vitest/dist/internal/internal.js","../../../../../node_modules/.pnpm/@effect+vitest@4.0.1_effect@4.0.1_vitest@5.0.3_@types+node@26.2.0_vite@7.3.2_@types+nod_65816e3353e20bfeb9b2e1494bdddeef/node_modules/@effect/vitest/dist/index.js","../../src/internal/socket.test.ts"],"sourcesContent":["/**\n * @since 4.0.0\n */\nimport * as Arbitrary from \"effect/Arbitrary\";\nimport * as Cause from \"effect/Cause\";\nimport * as Duration from \"effect/Duration\";\nimport * as Effect from \"effect/Effect\";\nimport * as Exit from \"effect/Exit\";\nimport { constVoid, flow, pipe } from \"effect/Function\";\nimport * as Layer from \"effect/Layer\";\nimport * as Schedule from \"effect/Schedule\";\nimport * as Scope from \"effect/Scope\";\nimport * as TestClock from \"effect/testing/TestClock\";\nimport * as TestConsole from \"effect/testing/TestConsole\";\nimport * as V from \"vitest\";\nconst getCurrentSuite = V.TestRunner.getCurrentSuite;\nconst runPromise = /*#__PURE__*/Effect.fnUntraced(function* (effect, _ctx) {\n const exit = yield* Effect.exit(effect);\n if (Exit.isFailure(exit)) {\n const errors = Cause.prettyErrors(exit.cause);\n for (let i = 0; i < errors.length; i++) {\n yield* Effect.logError(errors[i]);\n }\n }\n return yield* exit;\n}, (effect, _, ctx) => Effect.runPromise(effect, {\n signal: ctx?.signal\n}));\n/** @internal */\nconst runTest = ctx => effect => {\n const promise = runPromise(effect, ctx);\n if (ctx) {\n // Vitest stops awaiting the test promise once the signal aborts (timeout or\n // cancellation), so only then add a hook that waits for the finalizers.\n // Registering it unconditionally would change the teardown of every test.\n const onAbort = () => ctx.onTestFinished(() => promise.then(constVoid, constVoid));\n ctx.signal.addEventListener(\"abort\", onAbort, {\n once: true\n });\n const cleanup = () => ctx.signal.removeEventListener(\"abort\", onAbort);\n promise.then(cleanup, cleanup);\n // A retry after a timed-out attempt reuses the aborted signal, so no event fires.\n if (ctx.signal.aborted) onAbort();\n }\n return promise;\n};\nconst TestEnv = /*#__PURE__*/Layer.mergeAll(TestConsole.layer, /*#__PURE__*/TestClock.layer());\n/** @internal */\nexport const addEqualityTesters = () => {\n V.expect.addEqualityTesters([]);\n};\n/** @internal */\nconst testOptions = timeout => typeof timeout === \"number\" ? {\n timeout\n} : timeout ?? {};\nconst hookTimeout = timeout => timeout === undefined ? undefined : Duration.toMillis(Duration.fromInputUnsafe(timeout));\nconst propertyTestOptions = timeout => typeof timeout === \"number\" ? undefined : timeout;\nconst checkOptions = timeout => propertyTestOptions(timeout)?.arbitrary;\nconst compileArbitraryInput = input => Arbitrary.isArbitrary(input) ? input : Arbitrary.schema(input);\nconst makeArbitrary = arbitraries => Arbitrary.all(Array.isArray(arbitraries) ? arbitraries.map(compileArbitraryInput) : Object.fromEntries(Object.entries(arbitraries).map(([key, input]) => [key, compileArbitraryInput(input)])));\nconst normalizeProperty = (property, value) => Effect.catchCause(Effect.suspend(() => {\n const output = property(value);\n return Effect.isEffect(output) ? output : Effect.succeed(output);\n}), cause => Cause.hasInterrupts(cause) ? Effect.failCause(cause) : Effect.fail(cause));\nconst runCheck = (ctx, arbitrary, property, options) => runTest(ctx)(Effect.flatMapEager(Arbitrary.checkEffect(arbitrary, value => normalizeProperty(property, value), options), result => {\n const failure = Arbitrary.formatCheckFailure(result);\n return failure === undefined ? Effect.void : Effect.die(new Error(failure));\n}));\n// Vitest decides which fixtures to set up by parsing the source of a test\n// function's context parameter, and there is no public API to supply the names\n// for a wrapper, so wrappers expose the source of the function they call.\nconst withFixturesOf = (source, f) => Object.defineProperty(f, \"toString\", {\n value: () => source.toString()\n});\nconst makeItProxy = (it, overrides) => new Proxy(it, {\n apply(target, thisArg, argArray) {\n return Reflect.apply(target, thisArg, argArray);\n },\n get(target, property, receiver) {\n if (Object.hasOwn(overrides, property)) {\n return Reflect.get(overrides, property);\n }\n // do not bind: binding would strip vitest's static helpers (e.g. `describe.each`)\n return Reflect.get(target, property, receiver);\n }\n});\nconst collectTasks = (tasks, acc = []) => {\n for (let i = 0; i < tasks.length; i++) {\n const task = tasks[i];\n if (task.type === \"test\" && task.mode !== \"skip\" && task.mode !== \"todo\") {\n acc.push(task);\n } else if (task.tasks !== undefined) {\n collectTasks(task.tasks, acc);\n }\n }\n return acc;\n};\nconst registerProp = (it, name, arbitraries, property, timeout) => {\n const arbitrary = makeArbitrary(arbitraries);\n // Property callbacks receive only the base context; the empty source requests no fixtures.\n it(name, testOptions(timeout), withFixturesOf(() => {}, ctx => runCheck(ctx, arbitrary, values => property(values, ctx), checkOptions(timeout))));\n};\nconst makeTester = (mapEffect, it) => {\n const run = (ctx, args, self) => pipe(Effect.suspend(() => self(...args)), mapEffect, runTest(ctx));\n const register = test => (name, self, timeout) => test(name, testOptions(timeout), withFixturesOf(self, ctx => run(ctx, [ctx], self)));\n const each = cases => (name, self, timeout) => it.for(cases)(name, testOptions(timeout), withFixturesOf(self, (args, ctx) => run(ctx, [args, ctx], self).then(constVoid)));\n const prop = (name, arbitraries, self, timeout) => registerProp(it, name, arbitraries, (values, ctx) => Effect.mapEager(mapEffect(Effect.suspend(() => self(values, ctx))), value => value !== false), timeout);\n return Object.assign(register(it), {\n skip: register(it.skip),\n skipIf: condition => register(it.skipIf(condition)),\n runIf: condition => register(it.runIf(condition)),\n only: register(it.only),\n each,\n fails: register(it.fails),\n prop\n });\n};\nconst makeProp = it => (name, arbitraries, self, timeout) => registerProp(it, name, arbitraries, (values, ctx) => self(values, ctx) !== false, timeout);\nconst makeLayer = it => (layer_, options) => (...args) => {\n const excludeTestServices = options?.excludeTestServices ?? false;\n const withTestEnv = excludeTestServices ? layer_ : Layer.provideMerge(layer_, TestEnv);\n const memoMap = options?.memoMap ?? Effect.runSync(Layer.makeMemoMap);\n const scope = Effect.runSync(Scope.make());\n const contextEffect = Layer.buildWithMemoMap(withTestEnv, memoMap, scope).pipe(Effect.orDie, Effect.cached, Effect.runSync);\n let closed = false;\n const closeScope = () => {\n if (closed) {\n return Promise.resolve();\n }\n closed = true;\n // Layer cleanup must outlive the last test's already-aborted signal.\n return runPromise(Scope.close(scope, Exit.void));\n };\n const methods = makeItProxy(it, {\n effect: makeTester(effect => Effect.flatMap(contextEffect, context => effect.pipe(Effect.scoped, Effect.provide(context))), it),\n prop: makeProp(it),\n flakyTest,\n layer(nestedLayer, options) {\n return makeLayer(it)(Layer.provideMerge(nestedLayer, withTestEnv), {\n ...options,\n memoMap: Layer.forkMemoMapUnsafe(memoMap),\n excludeTestServices\n });\n }\n });\n if (args.length === 1) {\n const currentSuite = getCurrentSuite();\n const previousTasks = new Set(currentSuite.tasks);\n args[0](methods);\n const blockTasks = collectTasks(currentSuite.tasks.filter(task => !previousTasks.has(task)));\n if (blockTasks.length === 0) {\n V.afterAll(() => closeScope(), hookTimeout(options?.timeout));\n return;\n }\n const blockTaskSet = new Set(blockTasks);\n let remaining = blockTasks.length;\n V.beforeEach(\n // Destructured so Vitest can parse the hook once the suite defines fixtures.\n ({\n onTestFinished,\n signal,\n task\n }) => {\n if (!blockTaskSet.has(task)) {\n return;\n }\n onTestFinished(() => {\n remaining--;\n if (remaining === 0) {\n return closeScope();\n }\n });\n return runPromise(Effect.asVoid(contextEffect), {\n signal\n });\n }, hookTimeout(options?.timeout));\n V.afterAll(() => closeScope(), hookTimeout(options?.timeout));\n return;\n }\n const suiteOptions = options?.concurrent === undefined ? {} : {\n concurrent: options.concurrent\n };\n return V.describe(args[0], suiteOptions, () => {\n V.beforeAll(() => runPromise(Effect.asVoid(contextEffect)), hookTimeout(options?.timeout));\n V.afterAll(() => closeScope(), hookTimeout(options?.timeout));\n return args[1](methods);\n });\n};\n/** @internal */\nexport const flakyTest = (self, timeout = Duration.seconds(30)) => pipe(self, Effect.scoped, Effect.sandbox, Effect.retry(pipe(Schedule.recurs(10), Schedule.while(_ => Effect.succeed(Duration.isLessThanOrEqualTo(Duration.fromInputUnsafe(_.elapsed), Duration.fromInputUnsafe(timeout)))))), Effect.orDie);\n/** @internal */\nexport const makeMethods = it => makeItProxy(it, {\n effect: makeTester(flow(Effect.scoped, Effect.provide(TestEnv)), it),\n live: makeTester(Effect.scoped, it),\n flakyTest,\n layer: makeLayer(it),\n prop: makeProp(it)\n});\n/** @internal */\nexport const it = /*#__PURE__*/makeMethods(V.it);\n/** @internal */\nexport const {\n /** @internal */\n effect,\n /** @internal */\n layer,\n /** @internal */\n live,\n /** @internal */\n prop\n} = it;\n/** @internal */\nexport const describeWrapped = (name, f) => V.describe(name, () => f(it));\n//# sourceMappingURL=internal.js.map","import * as internal from \"./internal/internal.js\";\n/**\n * Re-exports the `vitest` API unchanged.\n *\n * @stability unstable\n * @since 4.0.0\n */\nexport * from \"vitest\";\n/**\n * @since 4.0.0\n */\nexport const addEqualityTesters = internal.addEqualityTesters;\n/**\n * @since 4.0.0\n */\nexport const effect = internal.effect;\n/**\n * @since 4.0.0\n */\nexport const live = internal.live;\n/**\n * Share a `Layer` between multiple tests, optionally wrapping\n * the tests in a `describe` block if a name is provided.\n *\n * Named layers accept `concurrent` to override inherited suite concurrency.\n * Anonymous layers always inherit the enclosing suite's concurrency.\n * Use `ctx.expect` in concurrent tests for test-local snapshots and assertion counts.\n *\n * @since 4.0.0\n *\n * ```ts\n * import { assert, layer } from \"@effect/vitest\"\n * import { Effect, Layer, Context } from \"effect\"\n *\n * class Foo extends Context.Service<Foo, \"foo\">()(\"Foo\") {\n * static layer = Layer.succeed(Foo, \"foo\")\n * }\n *\n * class Bar extends Context.Service<Bar, \"bar\">()(\"Bar\") {\n * static layer = Layer.effect(\n * Bar,\n * Effect.map(Foo, () => \"bar\" as const)\n * )\n * }\n *\n * layer(Foo.layer)(\"layer\", (it) => {\n * it.effect(\"adds context\", () =>\n * Effect.gen(function*() {\n * const foo = yield* Foo\n * assert.strictEqual(foo, \"foo\")\n * }))\n *\n * it.layer(Bar.layer)(\"nested\", (it) => {\n * it.effect(\"adds context\", () =>\n * Effect.gen(function*() {\n * const foo = yield* Foo\n * const bar = yield* Bar\n * assert.strictEqual(foo, \"foo\")\n * assert.strictEqual(bar, \"bar\")\n * }))\n * })\n * })\n * ```\n */\nexport const layer = internal.layer;\n/**\n * @since 4.0.0\n */\nexport const flakyTest = internal.flakyTest;\n/**\n * @since 4.0.0\n */\nexport const prop = internal.prop;\n/**\n * @since 4.0.0\n */\n/**\n * @since 4.0.0\n */\nexport const it = internal.it;\n/**\n * Creates the Effect test helpers for a Vitest test API, such as one extended with fixtures.\n *\n * **Details**\n *\n * Tests receive the fixtures they destructure from their context. Vitest sets them up before the test and tears\n * them down after the test's scope closes, as it does for its own tests. `it.effect.each` passes the context\n * after the test case, and named and anonymous `it.layer` blocks keep the fixtures.\n *\n * **Gotchas**\n *\n * Vitest reads the destructured names to decide which fixtures to set up. Once any fixture is defined, a test that\n * takes the whole context as a plain parameter, such as `(ctx) =>`, fails with a `FixtureParseError`. Property\n * tests receive only the base test context and cannot request fixtures; auto fixtures still run.\n *\n * **Example** (Using a Vitest fixture in an Effect test)\n *\n * ```ts\n * import { assert, makeMethods, test } from \"@effect/vitest\"\n * import { Effect } from \"effect\"\n *\n * const it = makeMethods(\n * test.extend(\"config\", { scope: \"file\" }, () => ({ port: 3000 }))\n * )\n *\n * it.effect(\"reads the config fixture\", ({ config }) =>\n * Effect.sync(() => {\n * assert.strictEqual(config.port, 3000)\n * }))\n * ```\n *\n * @since 4.0.0\n */\nexport const makeMethods = internal.makeMethods;\n/**\n * @since 4.0.0\n */\nexport const describeWrapped = internal.describeWrapped;\n//# sourceMappingURL=index.js.map","import { it as effect } from \"@effect/vitest\"\nimport { Effect, Exit, Layer, Option, Queue, Ref } from \"effect\"\nimport * as Socket from \"effect/socket/Socket\"\nimport { describe, expect, it } from \"vitest\"\nimport * as MessengerError from \"@effect-uai/core/MessengerError\"\nimport * as FakeWebSocket from \"@effect-uai/core/testing/FakeWebSocket\"\nimport { classifyDisconnect, connect, remember } from \"./socket.js\"\n\nconst command = (envelopeId: string) => ({\n type: \"slash_commands\",\n envelope_id: envelopeId,\n payload: { channel_id: \"C1\", user_id: \"U1\", command: \"/ping\" },\n})\n\n/** Each connection dials its own single-use URL, so each gets its own fake server. */\nconst slack = (connections: number) =>\n Effect.gen(function* () {\n const servers = yield* Effect.forEach(Array.from({ length: connections }), () =>\n FakeWebSocket.make({ greeting: [{ type: \"hello\" }] }),\n )\n const opened = yield* Ref.make(0)\n const open = Ref.modify(opened, (n): [string, number] => [`wss://slack.test/${n}`, n + 1])\n const dial: Socket.WebSocketConstructor[\"Service\"] = (url, protocols) =>\n servers[Number(url.split(\"/\").pop())]!.connect(url, protocols)\n const session = yield* connect({ open }).pipe(\n Effect.provide(Layer.succeed(Socket.WebSocketConstructor, dial)),\n )\n return { servers, opened: Ref.get(opened), session }\n })\n\ndescribe(\"classifyDisconnect\", () => {\n it(\"ends only on the reason Slack says not to retry\", () => {\n expect(classifyDisconnect(\"link_disabled\")).toBe(\"fatal\")\n // A rolling refresh is scheduled, so it reopens without backing off.\n expect([\"refresh_requested\", \"warning\"].map(classifyDisconnect)).toEqual([\"refresh\", \"refresh\"])\n expect(classifyDisconnect(undefined)).toBe(\"reconnect\")\n })\n})\n\ndescribe(\"remember\", () => {\n it(\"drops a redelivery of an id still in the set\", () => {\n const seen = Option.getOrThrow(remember([], \"Ev1\"))\n expect(remember(seen, \"Ev1\")).toEqual(Option.none())\n expect(Option.getOrThrow(remember(seen, \"Ev2\"))).toEqual([\"Ev1\", \"Ev2\"])\n })\n\n it(\"forgets the oldest once the set is full, so it cannot grow without bound\", () => {\n const full = [\"a\", \"b\"]\n expect(Option.getOrThrow(remember(full, \"c\", 2))).toEqual([\"b\", \"c\"])\n })\n})\n\ndescribe(\"connect\", () => {\n effect.live(\"acknowledges an envelope before handing it on\", () =>\n Effect.gen(function* () {\n const { servers, session } = yield* slack(1)\n yield* servers[0]!.push(command(\"e1\"))\n\n const incoming = yield* Queue.take(session.envelopes)\n expect(incoming.envelope.envelope_id).toBe(\"e1\")\n yield* servers[0]!.awaitSent(1)\n expect(yield* servers[0]!.sent).toEqual([{ envelope_id: \"e1\" }])\n }).pipe(Effect.scoped),\n )\n\n effect.live(\"fails to connect when no URL can be had before hello\", () =>\n Effect.gen(function* () {\n const exit = yield* connect({\n open: Effect.fail(\n new MessengerError.MessengerConnectFailed({\n provider: \"slack\",\n reason: \"invalid_auth\",\n raw: undefined,\n }),\n ),\n }).pipe(Effect.provide(Socket.layerWebSocketConstructorGlobal), Effect.exit)\n\n expect(Exit.isFailure(exit) && JSON.stringify(exit.cause)).toContain(\"invalid_auth\")\n }).pipe(Effect.scoped),\n )\n\n // Clean or dirty, a close Slack did not announce is a drop, and every drop reconnects.\n for (const code of [1000, 1006]) {\n effect.live(`reconnects on a fresh URL after a ${code} close`, () =>\n Effect.gen(function* () {\n const { servers, opened, session } = yield* slack(2)\n yield* servers[0]!.close(code)\n yield* servers[1]!.greeted\n yield* servers[1]!.push(command(\"e2\"))\n\n const incoming = yield* Queue.take(session.envelopes)\n expect(incoming.envelope.envelope_id).toBe(\"e2\")\n expect(yield* opened).toBe(2)\n yield* servers[1]!.awaitSent(1)\n expect(yield* servers[1]!.sent).toEqual([{ envelope_id: \"e2\" }])\n }).pipe(Effect.scoped),\n )\n }\n\n effect.live(\"closes and reconnects on a refresh disconnect\", () =>\n Effect.gen(function* () {\n const { servers, opened, session } = yield* slack(2)\n yield* servers[0]!.push({ type: \"disconnect\", reason: \"refresh_requested\" })\n yield* servers[1]!.greeted\n yield* servers[1]!.push(command(\"e3\"))\n\n const incoming = yield* Queue.take(session.envelopes)\n expect(incoming.envelope.envelope_id).toBe(\"e3\")\n expect(yield* opened).toBe(2)\n }).pipe(Effect.scoped),\n )\n\n effect.live(\"ends envelopes on a disconnect Slack says not to retry\", () =>\n Effect.gen(function* () {\n const { servers, opened, session } = yield* slack(1)\n yield* servers[0]!.push({ type: \"disconnect\", reason: \"link_disabled\" })\n\n const exit = yield* Effect.exit(Queue.take(session.envelopes))\n expect(exit).toEqual(\n Exit.fail(\n new MessengerError.MessengerTransportClosed({\n provider: \"slack\",\n reason: \"link_disabled\",\n }),\n ),\n )\n expect(yield* opened).toBe(1)\n }).pipe(Effect.scoped),\n )\n})\n"],"x_google_ignoreList":[0,1],"mappings":";;;;;;;;;;;;;;;;;;;;;AAeA,MAAM,kBAAA,WAA+B;AACrC,MAAM,aAA0B,uBAAO,WAAW,WAAW,QAAQ,MAAM;CACzE,MAAM,OAAO,OAAOA,SAAO,KAAK,MAAM;CACtC,IAAIC,OAAK,UAAU,IAAI,GAAG;EACxB,MAAM,SAASC,QAAM,aAAa,KAAK,KAAK;EAC5C,KAAK,IAAI,IAAI,GAAG,IAAI,OAAO,QAAQ,KACjC,OAAOF,SAAO,SAAS,OAAO,EAAE;CAEpC;CACA,OAAO,OAAO;AAChB,IAAI,QAAQ,GAAG,QAAQA,SAAO,WAAW,QAAQ,EAC/C,QAAQ,KAAK,OACf,CAAC,CAAC;;AAEF,MAAM,WAAU,SAAO,WAAU;CAC/B,MAAM,UAAU,WAAW,QAAQ,GAAG;CACtC,IAAI,KAAK;EAIP,MAAM,gBAAgB,IAAI,qBAAqB,QAAQ,KAAK,WAAW,SAAS,CAAC;EACjF,IAAI,OAAO,iBAAiB,SAAS,SAAS,EAC5C,MAAM,KACR,CAAC;EACD,MAAM,gBAAgB,IAAI,OAAO,oBAAoB,SAAS,OAAO;EACrE,QAAQ,KAAK,SAAS,OAAO;EAE7B,IAAI,IAAI,OAAO,SAAS,QAAQ;CAClC;CACA,OAAO;AACT;AACA,MAAM,UAAuB,sBAAM,SAAS,YAAY,OAAoB,wBAAU,MAAM,CAAC;;AAM7F,MAAM,eAAc,YAAW,OAAO,YAAY,WAAW,EAC3D,QACF,IAAI,WAAW,CAAC;AAChB,MAAM,eAAc,YAAW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,CAAE,KAAK,QAAQ,IAAI,CAAC;EAErC,MAAM,WAAW,OAAO,MAAM,KAAK,QAAQ,SAAS;EACpD,aAAO,SAAS,SAAS,WAAW,CAAC,CAAC,KAAK,IAAI;EAC/C,aAAO,OAAO,MAAM,CAAC,CAAC,KAAK,CAAC;CAC9B,CAAC,CAAC,CAAC,KAAK,OAAO,MAAM,CACvB;CAEA,GAAO,KAAK,gEACV,OAAO,IAAI,aAAa;EACtB,MAAM,EAAE,SAAS,QAAQ,YAAY,OAAO,MAAM,CAAC;EACnD,OAAO,QAAQ,EAAE,CAAE,KAAK;GAAE,MAAM;GAAc,QAAQ;EAAgB,CAAC;EAEvE,MAAM,OAAO,OAAO,OAAO,KAAK,MAAM,KAAK,QAAQ,SAAS,CAAC;EAC7D,aAAO,IAAI,CAAC,CAAC,QACX,KAAK,KACH,IAAI,eAAe,yBAAyB;GAC1C,UAAU;GACV,QAAQ;EACV,CAAC,CACH,CACF;EACA,aAAO,OAAO,MAAM,CAAC,CAAC,KAAK,CAAC;CAC9B,CAAC,CAAC,CAAC,KAAK,OAAO,MAAM,CACvB;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"socket.test.mjs","names":["Effect","Exit","Cause","Duration","Layer","V.describe","Scope","it","V.it","internal.it"],"sources":["../../../../../node_modules/.pnpm/@effect+vitest@4.1.2_effect@4.1.2_vitest@5.0.3_@types+node@26.2.0_vite@7.3.2_@types+nod_a2fffe0deec250ef9d6207b86a9a1ab8/node_modules/@effect/vitest/dist/internal/internal.js","../../../../../node_modules/.pnpm/@effect+vitest@4.1.2_effect@4.1.2_vitest@5.0.3_@types+node@26.2.0_vite@7.3.2_@types+nod_a2fffe0deec250ef9d6207b86a9a1ab8/node_modules/@effect/vitest/dist/index.js","../../src/internal/socket.test.ts"],"sourcesContent":["/**\n * @since 4.0.0\n */\nimport * as Arbitrary from \"effect/Arbitrary\";\nimport * as Cause from \"effect/Cause\";\nimport * as Duration from \"effect/Duration\";\nimport * as Effect from \"effect/Effect\";\nimport * as Exit from \"effect/Exit\";\nimport * as Fiber from \"effect/Fiber\";\nimport { constVoid, flow, pipe } from \"effect/Function\";\nimport * as Layer from \"effect/Layer\";\nimport * as Schedule from \"effect/Schedule\";\nimport * as Scope from \"effect/Scope\";\nimport * as TestClock from \"effect/testing/TestClock\";\nimport * as TestConsole from \"effect/testing/TestConsole\";\nimport * as V from \"vitest\";\nconst getCurrentSuite = V.TestRunner.getCurrentSuite;\nconst runPromise = (effect, ctx) => Effect.runPromise(\n// Only the test is interruptible: once the signal aborts, the fiber stops\n// at its next interruptible step, which would skip reporting the defects\n// raised by finalizers.\nEffect.uninterruptibleMask(restore => Effect.gen(function* () {\n const exit = yield* Effect.exit(restore(effect));\n if (Exit.isFailure(exit)) {\n const errors = Cause.prettyErrors(exit.cause);\n for (let i = 0; i < errors.length; i++) {\n yield* Effect.logError(errors[i]);\n }\n }\n return yield* exit;\n})), {\n signal: ctx?.signal\n});\nconst settleOnAbort = (ctx, promise) => {\n // Vitest stops awaiting the promise once the signal aborts (timeout or\n // cancellation), so only then add a hook that waits for the finalizers.\n // Registering it unconditionally would change the teardown of every test.\n const onAbort = () => ctx.onTestFinished(() => promise.then(constVoid, constVoid));\n ctx.signal.addEventListener(\"abort\", onAbort, {\n once: true\n });\n const cleanup = () => ctx.signal.removeEventListener(\"abort\", onAbort);\n promise.then(cleanup, cleanup);\n // A retry after a timed-out attempt reuses the aborted signal, so no event fires.\n if (ctx.signal.aborted) onAbort();\n return promise;\n};\n/** @internal */\nconst runTest = ctx => effect => {\n const promise = runPromise(effect, ctx);\n return ctx ? settleOnAbort(ctx, promise) : promise;\n};\nconst TestEnv = /*#__PURE__*/Layer.mergeAll(TestConsole.layer, /*#__PURE__*/TestClock.layer());\n/** @internal */\nexport const addEqualityTesters = () => {\n V.expect.addEqualityTesters([]);\n};\n/** @internal */\nconst testOptions = timeout => typeof timeout === \"number\" ? {\n timeout\n} : timeout ?? {};\nconst hookTimeout = timeout => timeout === undefined ? undefined : Duration.toMillis(Duration.fromInputUnsafe(timeout));\nconst propertyTestOptions = timeout => typeof timeout === \"number\" ? undefined : timeout;\nconst checkOptions = timeout => propertyTestOptions(timeout)?.arbitrary;\nconst compileArbitraryInput = input => Arbitrary.isArbitrary(input) ? input : Arbitrary.schema(input);\nconst makeArbitrary = arbitraries => Arbitrary.all(Array.isArray(arbitraries) ? arbitraries.map(compileArbitraryInput) : Object.fromEntries(Object.entries(arbitraries).map(([key, input]) => [key, compileArbitraryInput(input)])));\nconst normalizeProperty = (property, value) => Effect.catchCause(Effect.suspend(() => {\n const output = property(value);\n return Effect.isEffect(output) ? output : Effect.succeed(output);\n}), cause => Cause.hasInterrupts(cause) ? Effect.failCause(cause) : Effect.fail(cause));\nconst runCheck = (ctx, arbitrary, property, options) => runTest(ctx)(Effect.flatMapEager(Arbitrary.checkEffect(arbitrary, value => normalizeProperty(property, value), options), result => {\n const failure = Arbitrary.formatCheckFailure(result);\n return failure === undefined ? Effect.void : Effect.die(new Error(failure));\n}));\n// Vitest decides which fixtures to set up by parsing the source of a test\n// function's context parameter, and there is no public API to supply the names\n// for a wrapper, so wrappers expose the source of the function they call.\nconst withFixturesOf = (source, f) => Object.defineProperty(f, \"toString\", {\n value: () => source.toString()\n});\nconst runHook = (fn, run) => withFixturesOf(fn, (...args) => {\n const result = fn(...args);\n if (!Effect.isEffect(result)) {\n return result;\n }\n const scope = Scope.makeUnsafe();\n // Everything the hook leaves behind lives in the scope: the resources it\n // acquired and, ahead of them, a cleanup function it returned. On failure\n // the scope closes inside the fiber, so interrupting it awaits the release.\n const effect = Scope.provide(result, scope).pipe(Effect.flatMap(cleanup => typeof cleanup === \"function\" ? Scope.addFinalizer(scope, Effect.promise(async () => await cleanup())) : Effect.void), Effect.onError(cause => Scope.close(scope, Exit.failCause(cause))));\n return run(args, effect, scope);\n});\n// Closing must outlive an already-aborted signal, so it runs without one.\nconst closeHookScope = scope => runPromise(Scope.close(scope, Exit.void));\n/** @internal */\nexport const beforeAll = (fn, timeout) => {\n let dispose = () => Promise.resolve();\n // Vitest drops the cleanup of a setup that outlives its timeout, so the\n // scope is disposed by the cleanup of a hook registered just before this\n // one. It runs in the same cleanup phase, in the slot next to this hook's,\n // with this hook's timeout.\n V.beforeAll(() => () => dispose(), timeout);\n V.beforeAll(runHook(fn, (_, effect, scope) => {\n const fiber = Effect.runFork(effect);\n // Interrupting a setup that Vitest stopped waiting for awaits its release.\n dispose = () => runPromise(Effect.andThen(Fiber.interrupt(fiber), Scope.close(scope, Exit.void)));\n return runPromise(Fiber.join(fiber));\n }), timeout);\n};\n/** @internal */\nexport const beforeEach = (fn, timeout) => V.beforeEach(runHook(fn, ([ctx], effect, scope) =>\n// The scope closes when Vitest runs the hook's cleanup after the test,\n// and the next test waits for it even if that cleanup times out.\nrunTest(ctx)(effect).then(() => () => settleOnAbort(ctx, closeHookScope(scope)))), timeout);\nconst makeItProxy = (it, overrides) => new Proxy(it, {\n apply(target, thisArg, argArray) {\n return Reflect.apply(target, thisArg, argArray);\n },\n get(target, property, receiver) {\n if (Object.hasOwn(overrides, property)) {\n return Reflect.get(overrides, property);\n }\n // do not bind: binding would strip vitest's static helpers (e.g. `describe.each`)\n return Reflect.get(target, property, receiver);\n }\n});\nconst collectTasks = (tasks, acc = []) => {\n for (let i = 0; i < tasks.length; i++) {\n const task = tasks[i];\n if (task.type === \"test\" && task.mode !== \"skip\" && task.mode !== \"todo\") {\n acc.push(task);\n } else if (task.tasks !== undefined) {\n collectTasks(task.tasks, acc);\n }\n }\n return acc;\n};\nconst runsMoreThanOnce = task => {\n const retry = typeof task.retry === \"number\" ? task.retry : task.retry?.count;\n return (retry ?? 0) > 0 || (task.repeats ?? 0) > 0;\n};\nconst registerProp = (it, name, arbitraries, property, timeout) => {\n const arbitrary = makeArbitrary(arbitraries);\n // Property callbacks receive only the base context; the empty source requests no fixtures.\n it(name, testOptions(timeout), withFixturesOf(() => {}, ctx => runCheck(ctx, arbitrary, values => property(values, ctx), checkOptions(timeout))));\n};\nconst makeTester = (mapEffect, it) => {\n const run = (ctx, args, self) => pipe(Effect.suspend(() => self(...args)), mapEffect, runTest(ctx));\n const register = test => (name, self, timeout) => test(name, testOptions(timeout), withFixturesOf(self, ctx => run(ctx, [ctx], self)));\n const each = cases => (name, self, timeout) => it.for(cases)(name, testOptions(timeout), withFixturesOf(self, (args, ctx) => run(ctx, [args, ctx], self).then(constVoid)));\n const prop = (name, arbitraries, self, timeout) => registerProp(it, name, arbitraries, (values, ctx) => Effect.mapEager(mapEffect(Effect.suspend(() => self(values, ctx))), value => value !== false), timeout);\n return Object.assign(register(it), {\n skip: register(it.skip),\n skipIf: condition => register(it.skipIf(condition)),\n runIf: condition => register(it.runIf(condition)),\n only: register(it.only),\n each,\n fails: register(it.fails),\n prop\n });\n};\nconst makeProp = it => (name, arbitraries, self, timeout) => registerProp(it, name, arbitraries, (values, ctx) => {\n const result = self(values, ctx);\n if (result !== undefined && typeof result !== \"boolean\") {\n throw new TypeError(\"it.prop callbacks must return boolean or void. Use it.effect.prop for Effect callbacks.\");\n }\n return result !== false;\n}, timeout);\nconst makeLayer = it => (layer_, options) => (...args) => {\n const excludeTestServices = options?.excludeTestServices ?? false;\n const withTestEnv = excludeTestServices ? layer_ : Layer.provideMerge(layer_, TestEnv);\n const memoMap = options?.memoMap ?? Effect.runSync(Layer.makeMemoMap);\n const buildPerTest = options?.buildPerTest ?? false;\n const suiteOptions = options?.concurrent === undefined ? {} : {\n concurrent: options.concurrent\n };\n const makeBlockMethods = provide => makeItProxy(it, {\n effect: makeTester(effect => provide(Effect.scoped(effect)), it),\n prop: makeProp(it),\n flakyTest,\n layer(nestedLayer, nestedOptions) {\n return makeLayer(it)(Layer.provideMerge(nestedLayer, withTestEnv), {\n ...nestedOptions,\n memoMap: Layer.forkMemoMapUnsafe(memoMap),\n excludeTestServices,\n // The services of a per-test block only exist during a test, so\n // blocks nested in it are built per test as well.\n buildPerTest: buildPerTest || nestedOptions?.buildPerTest === true\n });\n }\n });\n if (buildPerTest) {\n // Each test builds into its own fork of the memo map, so it reuses the\n // services of enclosing blocks and releases the rest when it finishes.\n const methods = makeBlockMethods(effect => Effect.scopedWith(scope => Layer.buildWithMemoMap(withTestEnv, Layer.forkMemoMapUnsafe(memoMap), scope).pipe(Effect.orDie, Effect.flatMap(context => Effect.provide(effect, context)))));\n if (args.length === 1) {\n return args[0](methods);\n }\n return V.describe(args[0], suiteOptions, () => args[1](methods));\n }\n const scope = Effect.runSync(Scope.make());\n const contextEffect = Layer.buildWithMemoMap(withTestEnv, memoMap, scope).pipe(Effect.orDie, Effect.cached, Effect.runSync);\n let closed = false;\n const closeScope = () => {\n if (closed) {\n return Promise.resolve();\n }\n closed = true;\n // Layer cleanup must outlive the last test's already-aborted signal.\n return runPromise(Scope.close(scope, Exit.void));\n };\n const methods = makeBlockMethods(effect => Effect.flatMap(contextEffect, context => Effect.provide(effect, context)));\n if (args.length === 1) {\n const currentSuite = getCurrentSuite();\n const previousTasks = new Set(currentSuite.tasks);\n args[0](methods);\n const blockTasks = collectTasks(currentSuite.tasks.filter(task => !previousTasks.has(task)));\n if (blockTasks.length === 0) {\n V.afterAll(() => closeScope(), hookTimeout(options?.timeout));\n return;\n }\n const blockTaskSet = new Set(blockTasks);\n // Vitest runs hooks once per retry and repeat attempt, so a test's last\n // attempt cannot be counted. Blocks with such tests are released by `afterAll`.\n const releaseAfterLastTest = !blockTasks.some(runsMoreThanOnce);\n let remaining = blockTasks.length;\n V.beforeEach(\n // Destructured so Vitest can parse the hook once the suite defines fixtures.\n ({\n onTestFinished,\n signal,\n task\n }) => {\n if (!blockTaskSet.has(task)) {\n return;\n }\n if (releaseAfterLastTest) {\n onTestFinished(() => {\n remaining--;\n if (remaining === 0) {\n return closeScope();\n }\n });\n }\n return runPromise(Effect.asVoid(contextEffect), {\n signal\n });\n }, hookTimeout(options?.timeout));\n V.afterAll(() => closeScope(), hookTimeout(options?.timeout));\n return;\n }\n return V.describe(args[0], suiteOptions, () => {\n V.beforeAll(() => runPromise(Effect.asVoid(contextEffect)), hookTimeout(options?.timeout));\n V.afterAll(() => closeScope(), hookTimeout(options?.timeout));\n return args[1](methods);\n });\n};\n/** @internal */\nexport const flakyTest = (self, timeout = Duration.seconds(30)) => pipe(self, Effect.scoped, Effect.sandbox, Effect.retry(pipe(Schedule.recurs(10), Schedule.while(_ => Effect.succeed(Duration.isLessThanOrEqualTo(Duration.fromInputUnsafe(_.elapsed), Duration.fromInputUnsafe(timeout)))))), Effect.orDie);\n/** @internal */\nexport const makeMethods = it => makeItProxy(it, {\n effect: makeTester(flow(Effect.scoped, Effect.provide(TestEnv)), it),\n live: makeTester(Effect.scoped, it),\n flakyTest,\n layer: makeLayer(it),\n prop: makeProp(it)\n});\n/** @internal */\nexport const it = /*#__PURE__*/makeMethods(V.it);\n/** @internal */\nexport const {\n /** @internal */\n effect,\n /** @internal */\n layer,\n /** @internal */\n live,\n /** @internal */\n prop\n} = it;\n/** @internal */\nexport const describeWrapped = (name, f) => V.describe(name, () => f(it));\n//# sourceMappingURL=internal.js.map","import * as internal from \"./internal/internal.js\";\n/**\n * Re-exports the `vitest` API unchanged.\n *\n * @stability unstable\n * @since 4.0.0\n */\nexport * from \"vitest\";\n/**\n * Invokes the Effect Vitest equality-tester registration hook.\n *\n * @stability unstable\n * @category utils\n * @since 4.0.0\n */\nexport const addEqualityTesters = internal.addEqualityTesters;\n/**\n * Registers a callback to run once before all tests in the current suite. If\n * the callback returns an `Effect`, it is run and awaited with a `Scope` that\n * closes in a cleanup after the suite's `afterAll` hooks, within the hook's\n * timeout. The `Effect` must not require any other services.\n *\n * **Details**\n *\n * If Vitest stops waiting for the setup, the setup is interrupted before the\n * `Scope` closes. As with any `beforeAll` cleanup, Vitest reports a closing\n * that exceeds the hook's timeout and does not wait for it.\n *\n * @stability unstable\n * @category hooks\n * @since 4.0.0\n */\nexport const beforeAll = internal.beforeAll;\n/**\n * Registers a callback to run before each test in the current suite. If the\n * callback returns an `Effect`, it is run and awaited with a `Scope` that\n * closes when the test finishes, and interrupted if the hook times out. The\n * `Effect` must not require any other services.\n *\n * @stability unstable\n * @category hooks\n * @since 4.0.0\n */\nexport const beforeEach = internal.beforeEach;\n/**\n * Runs a scoped Effect test with test clock and console services.\n *\n * @stability unstable\n * @category testing\n * @since 4.0.0\n */\nexport const effect = internal.effect;\n/**\n * Runs a scoped Effect test with live services.\n *\n * @stability unstable\n * @category testing\n * @since 4.0.0\n */\nexport const live = internal.live;\n/**\n * Share a `Layer` between multiple tests, optionally wrapping\n * the tests in a `describe` block if a name is provided.\n *\n * **Details**\n *\n * Named layers accept `concurrent` to override inherited suite concurrency.\n * Anonymous layers always inherit the enclosing suite's concurrency.\n * Use `ctx.expect` in concurrent tests for test-local snapshots and assertion counts.\n *\n * Pass `buildPerTest: true` to build the layer once per test instead of once\n * per block. Each test gets new services, released when the test finishes,\n * while services from an enclosing `layer` block stay shared. A build failure\n * fails only that test. Blocks nested inside a per-test block are built per\n * test as well. `timeout` has no effect on a per-test block, since the test's\n * own timeout covers the build.\n *\n * **Example** (Sharing layers between tests)\n *\n * ```ts\n * import { assert, layer } from \"@effect/vitest\"\n * import { Effect, Layer, Context } from \"effect\"\n *\n * class Foo extends Context.Service<Foo, \"foo\">()(\"Foo\") {\n * static layer = Layer.succeed(Foo, \"foo\")\n * }\n *\n * class Bar extends Context.Service<Bar, \"bar\">()(\"Bar\") {\n * static layer = Layer.effect(\n * Bar,\n * Effect.map(Foo, () => \"bar\" as const)\n * )\n * }\n *\n * layer(Foo.layer)(\"layer\", (it) => {\n * it.effect(\"adds context\", () =>\n * Effect.gen(function*() {\n * const foo = yield* Foo\n * assert.strictEqual(foo, \"foo\")\n * }))\n *\n * it.layer(Bar.layer)(\"nested\", (it) => {\n * it.effect(\"adds context\", () =>\n * Effect.gen(function*() {\n * const foo = yield* Foo\n * const bar = yield* Bar\n * assert.strictEqual(foo, \"foo\")\n * assert.strictEqual(bar, \"bar\")\n * }))\n * })\n * })\n * ```\n *\n * **Example** (Building a layer for each test)\n *\n * ```ts\n * import { assert, layer } from \"@effect/vitest\"\n * import { Effect, Layer, Context, Ref } from \"effect\"\n *\n * class Database extends Context.Service<Database, \"database\">()(\"Database\") {\n * static layer = Layer.succeed(Database, \"database\")\n * }\n *\n * class Cache extends Context.Service<Cache, Ref.Ref<Array<string>>>()(\"Cache\") {\n * static layer = Layer.effect(\n * Cache,\n * Effect.andThen(Database, Ref.make<Array<string>>([]))\n * )\n * }\n *\n * layer(Database.layer)(\"repository\", (it) => {\n * // Database is shared, Cache is built for each test\n * it.layer(Cache.layer, { buildPerTest: true })((it) => {\n * it.effect(\"writes to the cache\", () =>\n * Effect.gen(function*() {\n * const cache = yield* Cache\n * yield* Ref.update(cache, (keys) => [...keys, \"a\"])\n * assert.deepStrictEqual(yield* Ref.get(cache), [\"a\"])\n * }))\n *\n * it.effect(\"starts with an empty cache\", () =>\n * Effect.gen(function*() {\n * const cache = yield* Cache\n * assert.deepStrictEqual(yield* Ref.get(cache), [])\n * }))\n * })\n * })\n * ```\n *\n * @stability unstable\n * @category testing\n * @since 4.0.0\n */\nexport const layer = internal.layer;\n/**\n * Retries a scoped Effect to tolerate intermittent test failures, dying on exhausted retries.\n *\n * @stability unstable\n * @category testing\n * @since 4.0.0\n */\nexport const flakyTest = internal.flakyTest;\n/**\n * Runs a synchronous property test using schemas or arbitraries.\n *\n * @stability unstable\n * @category testing\n * @since 4.0.0\n */\nexport const prop = internal.prop;\n/**\n * Vitest test API extended with Effect test helpers.\n *\n * @stability unstable\n * @category testing\n * @since 4.0.0\n */\nexport const it = internal.it;\n/**\n * Creates the Effect test helpers for a Vitest test API, such as one extended with fixtures.\n *\n * **Details**\n *\n * Tests receive the fixtures they destructure from their context. Vitest sets them up before the test and tears\n * them down after the test's scope closes, as it does for its own tests. `it.effect.each` passes the context\n * after the test case, and named and anonymous `it.layer` blocks keep the fixtures.\n *\n * **Gotchas**\n *\n * Vitest reads the destructured names to decide which fixtures to set up. Once any fixture is defined, a test that\n * takes the whole context as a plain parameter, such as `(ctx) =>`, fails with a `FixtureParseError`. Property\n * tests receive only the base test context and cannot request fixtures; auto fixtures still run.\n *\n * **Example** (Using a Vitest fixture in an Effect test)\n *\n * ```ts\n * import { assert, makeMethods, test } from \"@effect/vitest\"\n * import { Effect } from \"effect\"\n *\n * const it = makeMethods(\n * test.extend(\"config\", { scope: \"file\" }, () => ({ port: 3000 }))\n * )\n *\n * it.effect(\"reads the config fixture\", ({ config }) =>\n * Effect.sync(() => {\n * assert.strictEqual(config.port, 3000)\n * }))\n * ```\n *\n * @stability unstable\n * @category constructors\n * @since 4.0.0\n */\nexport const makeMethods = internal.makeMethods;\n/**\n * Creates a named Vitest suite whose callback receives Effect test helpers.\n *\n * @stability unstable\n * @category testing\n * @since 4.0.0\n */\nexport const describeWrapped = internal.describeWrapped;\n//# sourceMappingURL=index.js.map","import { it as effect } from \"@effect/vitest\"\nimport { Effect, Exit, Layer, Option, Queue, Ref } from \"effect\"\nimport * as Socket from \"effect/socket/Socket\"\nimport { describe, expect, it } from \"vitest\"\nimport * as MessengerError from \"@effect-uai/core/MessengerError\"\nimport * as FakeWebSocket from \"@effect-uai/core/testing/FakeWebSocket\"\nimport { classifyDisconnect, connect, remember } from \"./socket.js\"\n\nconst command = (envelopeId: string) => ({\n type: \"slash_commands\",\n envelope_id: envelopeId,\n payload: { channel_id: \"C1\", user_id: \"U1\", command: \"/ping\" },\n})\n\n/** Each connection dials its own single-use URL, so each gets its own fake server. */\nconst slack = (connections: number) =>\n Effect.gen(function* () {\n const servers = yield* Effect.forEach(Array.from({ length: connections }), () =>\n FakeWebSocket.make({ greeting: [{ type: \"hello\" }] }),\n )\n const opened = yield* Ref.make(0)\n const open = Ref.modify(opened, (n): [string, number] => [`wss://slack.test/${n}`, n + 1])\n const dial: Socket.WebSocketConstructor[\"Service\"] = (url, protocols) =>\n servers[Number(url.split(\"/\").pop())]!.connect(url, protocols)\n const session = yield* connect({ open }).pipe(\n Effect.provide(Layer.succeed(Socket.WebSocketConstructor, dial)),\n )\n return { servers, opened: Ref.get(opened), session }\n })\n\ndescribe(\"classifyDisconnect\", () => {\n it(\"ends only on the reason Slack says not to retry\", () => {\n expect(classifyDisconnect(\"link_disabled\")).toBe(\"fatal\")\n // A rolling refresh is scheduled, so it reopens without backing off.\n expect([\"refresh_requested\", \"warning\"].map(classifyDisconnect)).toEqual([\"refresh\", \"refresh\"])\n expect(classifyDisconnect(undefined)).toBe(\"reconnect\")\n })\n})\n\ndescribe(\"remember\", () => {\n it(\"drops a redelivery of an id still in the set\", () => {\n const seen = Option.getOrThrow(remember([], \"Ev1\"))\n expect(remember(seen, \"Ev1\")).toEqual(Option.none())\n expect(Option.getOrThrow(remember(seen, \"Ev2\"))).toEqual([\"Ev1\", \"Ev2\"])\n })\n\n it(\"forgets the oldest once the set is full, so it cannot grow without bound\", () => {\n const full = [\"a\", \"b\"]\n expect(Option.getOrThrow(remember(full, \"c\", 2))).toEqual([\"b\", \"c\"])\n })\n})\n\ndescribe(\"connect\", () => {\n effect.live(\"acknowledges an envelope before handing it on\", () =>\n Effect.gen(function* () {\n const { servers, session } = yield* slack(1)\n yield* servers[0]!.push(command(\"e1\"))\n\n const incoming = yield* Queue.take(session.envelopes)\n expect(incoming.envelope.envelope_id).toBe(\"e1\")\n yield* servers[0]!.awaitSent(1)\n expect(yield* servers[0]!.sent).toEqual([{ envelope_id: \"e1\" }])\n }).pipe(Effect.scoped),\n )\n\n effect.live(\"fails to connect when no URL can be had before hello\", () =>\n Effect.gen(function* () {\n const exit = yield* connect({\n open: Effect.fail(\n new MessengerError.MessengerConnectFailed({\n provider: \"slack\",\n reason: \"invalid_auth\",\n raw: undefined,\n }),\n ),\n }).pipe(Effect.provide(Socket.layerWebSocketConstructorGlobal), Effect.exit)\n\n expect(Exit.isFailure(exit) && JSON.stringify(exit.cause)).toContain(\"invalid_auth\")\n }).pipe(Effect.scoped),\n )\n\n // Clean or dirty, a close Slack did not announce is a drop, and every drop reconnects.\n for (const code of [1000, 1006]) {\n effect.live(`reconnects on a fresh URL after a ${code} close`, () =>\n Effect.gen(function* () {\n const { servers, opened, session } = yield* slack(2)\n yield* servers[0]!.close(code)\n yield* servers[1]!.greeted\n yield* servers[1]!.push(command(\"e2\"))\n\n const incoming = yield* Queue.take(session.envelopes)\n expect(incoming.envelope.envelope_id).toBe(\"e2\")\n expect(yield* opened).toBe(2)\n yield* servers[1]!.awaitSent(1)\n expect(yield* servers[1]!.sent).toEqual([{ envelope_id: \"e2\" }])\n }).pipe(Effect.scoped),\n )\n }\n\n effect.live(\"closes and reconnects on a refresh disconnect\", () =>\n Effect.gen(function* () {\n const { servers, opened, session } = yield* slack(2)\n yield* servers[0]!.push({ type: \"disconnect\", reason: \"refresh_requested\" })\n yield* servers[1]!.greeted\n yield* servers[1]!.push(command(\"e3\"))\n\n const incoming = yield* Queue.take(session.envelopes)\n expect(incoming.envelope.envelope_id).toBe(\"e3\")\n expect(yield* opened).toBe(2)\n }).pipe(Effect.scoped),\n )\n\n effect.live(\"ends envelopes on a disconnect Slack says not to retry\", () =>\n Effect.gen(function* () {\n const { servers, opened, session } = yield* slack(1)\n yield* servers[0]!.push({ type: \"disconnect\", reason: \"link_disabled\" })\n\n const exit = yield* Effect.exit(Queue.take(session.envelopes))\n expect(exit).toEqual(\n Exit.fail(\n new MessengerError.MessengerTransportClosed({\n provider: \"slack\",\n reason: \"link_disabled\",\n }),\n ),\n )\n expect(yield* opened).toBe(1)\n }).pipe(Effect.scoped),\n )\n})\n"],"x_google_ignoreList":[0,1],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAgBA,MAAM,kBAAA,WAA+B;AACrC,MAAM,cAAc,QAAQ,QAAQA,SAAO,WAI3CA,SAAO,qBAAoB,YAAWA,SAAO,IAAI,aAAa;CAC5D,MAAM,OAAO,OAAOA,SAAO,KAAK,QAAQ,MAAM,CAAC;CAC/C,IAAIC,OAAK,UAAU,IAAI,GAAG;EACxB,MAAM,SAASC,QAAM,aAAa,KAAK,KAAK;EAC5C,K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,KAAK,CAAC,CAAC;CACjE,CAAC,CAAC,CAAC,KAAK,OAAO,MAAM,CACvB;CAGF,GAAO,KAAK,uDACV,OAAO,IAAI,aAAa;EACtB,MAAM,EAAE,SAAS,QAAQ,YAAY,OAAO,MAAM,CAAC;EACnD,OAAO,QAAQ,EAAE,CAAE,KAAK;GAAE,MAAM;GAAc,QAAQ;EAAoB,CAAC;EAC3E,OAAO,QAAQ,EAAE,CAAE;EACnB,OAAO,QAAQ,EAAE,CAAE,KAAK,QAAQ,IAAI,CAAC;EAErC,MAAM,WAAW,OAAO,MAAM,KAAK,QAAQ,SAAS;EACpD,aAAO,SAAS,SAAS,WAAW,CAAC,CAAC,KAAK,IAAI;EAC/C,aAAO,OAAO,MAAM,CAAC,CAAC,KAAK,CAAC;CAC9B,CAAC,CAAC,CAAC,KAAK,OAAO,MAAM,CACvB;CAEA,GAAO,KAAK,gEACV,OAAO,IAAI,aAAa;EACtB,MAAM,EAAE,SAAS,QAAQ,YAAY,OAAO,MAAM,CAAC;EACnD,OAAO,QAAQ,EAAE,CAAE,KAAK;GAAE,MAAM;GAAc,QAAQ;EAAgB,CAAC;EAEvE,MAAM,OAAO,OAAO,OAAO,KAAK,MAAM,KAAK,QAAQ,SAAS,CAAC;EAC7D,aAAO,IAAI,CAAC,CAAC,QACX,KAAK,KACH,IAAI,eAAe,yBAAyB;GAC1C,UAAU;GACV,QAAQ;EACV,CAAC,CACH,CACF;EACA,aAAO,OAAO,MAAM,CAAC,CAAC,KAAK,CAAC;CAC9B,CAAC,CAAC,CAAC,KAAK,OAAO,MAAM,CACvB;AACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect-uai/slack",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0-dev-20261109183959",
|
|
4
4
|
"description": "Slack provider for @effect-uai/core (Messenger capability over Socket Mode and the Web API).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agents",
|
|
@@ -44,12 +44,12 @@
|
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"effect": "4.
|
|
47
|
+
"effect": "4.1.2",
|
|
48
48
|
"typescript": "^7.0.2",
|
|
49
|
-
"@effect-uai/core": "0.
|
|
49
|
+
"@effect-uai/core": "0.19.0-dev-20261109183959"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"@effect-uai/core": "
|
|
52
|
+
"@effect-uai/core": "0.19.0-dev-20261109183959",
|
|
53
53
|
"effect": ">=4.0.1 <5.0.0"
|
|
54
54
|
},
|
|
55
55
|
"scripts": {
|