chore: generate
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -61,7 +61,11 @@ const make = <R, E>(testLayer: Layer.Layer<R, E>, liveLayer: Layer.Layer<R, E>)
|
|||||||
opts?: number | TestOptions,
|
opts?: number | TestOptions,
|
||||||
) => {
|
) => {
|
||||||
const args = instanceArgs(options, opts)
|
const args = instanceArgs(options, opts)
|
||||||
return test(name, () => run(body(value).pipe(withTmpdirInstance(args.instanceOptions)), liveLayer), args.testOptions)
|
return test(
|
||||||
|
name,
|
||||||
|
() => run(body(value).pipe(withTmpdirInstance(args.instanceOptions)), liveLayer),
|
||||||
|
args.testOptions,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
instance.only = <A, E2>(
|
instance.only = <A, E2>(
|
||||||
@@ -71,7 +75,11 @@ const make = <R, E>(testLayer: Layer.Layer<R, E>, liveLayer: Layer.Layer<R, E>)
|
|||||||
opts?: number | TestOptions,
|
opts?: number | TestOptions,
|
||||||
) => {
|
) => {
|
||||||
const args = instanceArgs(options, opts)
|
const args = instanceArgs(options, opts)
|
||||||
return test.only(name, () => run(body(value).pipe(withTmpdirInstance(args.instanceOptions)), liveLayer), args.testOptions)
|
return test.only(
|
||||||
|
name,
|
||||||
|
() => run(body(value).pipe(withTmpdirInstance(args.instanceOptions)), liveLayer),
|
||||||
|
args.testOptions,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
instance.skip = <A, E2>(
|
instance.skip = <A, E2>(
|
||||||
@@ -81,7 +89,11 @@ const make = <R, E>(testLayer: Layer.Layer<R, E>, liveLayer: Layer.Layer<R, E>)
|
|||||||
opts?: number | TestOptions,
|
opts?: number | TestOptions,
|
||||||
) => {
|
) => {
|
||||||
const args = instanceArgs(options, opts)
|
const args = instanceArgs(options, opts)
|
||||||
return test.skip(name, () => run(body(value).pipe(withTmpdirInstance(args.instanceOptions)), liveLayer), args.testOptions)
|
return test.skip(
|
||||||
|
name,
|
||||||
|
() => run(body(value).pipe(withTmpdirInstance(args.instanceOptions)), liveLayer),
|
||||||
|
args.testOptions,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
return { effect, live, instance }
|
return { effect, live, instance }
|
||||||
|
|||||||
@@ -54,7 +54,9 @@ const waitForPending = (count: number) =>
|
|||||||
return yield* Effect.fail(new Error(`timed out waiting for ${count} pending question request(s)`))
|
return yield* Effect.fail(new Error(`timed out waiting for ${count} pending question request(s)`))
|
||||||
})
|
})
|
||||||
|
|
||||||
it.instance("ask - remains pending until answered", () =>
|
it.instance(
|
||||||
|
"ask - remains pending until answered",
|
||||||
|
() =>
|
||||||
Effect.gen(function* () {
|
Effect.gen(function* () {
|
||||||
const fiber = yield* askEffect({
|
const fiber = yield* askEffect({
|
||||||
sessionID: SessionID.make("ses_test"),
|
sessionID: SessionID.make("ses_test"),
|
||||||
@@ -77,7 +79,9 @@ it.instance("ask - remains pending until answered", () =>
|
|||||||
{ git: true },
|
{ git: true },
|
||||||
)
|
)
|
||||||
|
|
||||||
it.instance("ask - adds to pending list", () =>
|
it.instance(
|
||||||
|
"ask - adds to pending list",
|
||||||
|
() =>
|
||||||
Effect.gen(function* () {
|
Effect.gen(function* () {
|
||||||
const questions = [
|
const questions = [
|
||||||
{
|
{
|
||||||
@@ -106,7 +110,9 @@ it.instance("ask - adds to pending list", () =>
|
|||||||
|
|
||||||
// reply tests
|
// reply tests
|
||||||
|
|
||||||
it.instance("reply - resolves the pending ask with answers", () =>
|
it.instance(
|
||||||
|
"reply - resolves the pending ask with answers",
|
||||||
|
() =>
|
||||||
Effect.gen(function* () {
|
Effect.gen(function* () {
|
||||||
const questions = [
|
const questions = [
|
||||||
{
|
{
|
||||||
@@ -137,7 +143,9 @@ it.instance("reply - resolves the pending ask with answers", () =>
|
|||||||
{ git: true },
|
{ git: true },
|
||||||
)
|
)
|
||||||
|
|
||||||
it.instance("reply - removes from pending list", () =>
|
it.instance(
|
||||||
|
"reply - removes from pending list",
|
||||||
|
() =>
|
||||||
Effect.gen(function* () {
|
Effect.gen(function* () {
|
||||||
const fiber = yield* askEffect({
|
const fiber = yield* askEffect({
|
||||||
sessionID: SessionID.make("ses_test"),
|
sessionID: SessionID.make("ses_test"),
|
||||||
@@ -168,7 +176,9 @@ it.instance("reply - removes from pending list", () =>
|
|||||||
{ git: true },
|
{ git: true },
|
||||||
)
|
)
|
||||||
|
|
||||||
it.instance("reply - does nothing for unknown requestID", () =>
|
it.instance(
|
||||||
|
"reply - does nothing for unknown requestID",
|
||||||
|
() =>
|
||||||
replyEffect({
|
replyEffect({
|
||||||
requestID: QuestionID.make("que_unknown"),
|
requestID: QuestionID.make("que_unknown"),
|
||||||
answers: [["Option 1"]],
|
answers: [["Option 1"]],
|
||||||
@@ -178,7 +188,9 @@ it.instance("reply - does nothing for unknown requestID", () =>
|
|||||||
|
|
||||||
// reject tests
|
// reject tests
|
||||||
|
|
||||||
it.instance("reject - throws RejectedError", () =>
|
it.instance(
|
||||||
|
"reject - throws RejectedError",
|
||||||
|
() =>
|
||||||
Effect.gen(function* () {
|
Effect.gen(function* () {
|
||||||
const fiber = yield* askEffect({
|
const fiber = yield* askEffect({
|
||||||
sessionID: SessionID.make("ses_test"),
|
sessionID: SessionID.make("ses_test"),
|
||||||
@@ -204,7 +216,9 @@ it.instance("reject - throws RejectedError", () =>
|
|||||||
{ git: true },
|
{ git: true },
|
||||||
)
|
)
|
||||||
|
|
||||||
it.instance("reject - removes from pending list", () =>
|
it.instance(
|
||||||
|
"reject - removes from pending list",
|
||||||
|
() =>
|
||||||
Effect.gen(function* () {
|
Effect.gen(function* () {
|
||||||
const fiber = yield* askEffect({
|
const fiber = yield* askEffect({
|
||||||
sessionID: SessionID.make("ses_test"),
|
sessionID: SessionID.make("ses_test"),
|
||||||
@@ -232,11 +246,15 @@ it.instance("reject - removes from pending list", () =>
|
|||||||
{ git: true },
|
{ git: true },
|
||||||
)
|
)
|
||||||
|
|
||||||
it.instance("reject - does nothing for unknown requestID", () => rejectEffect(QuestionID.make("que_unknown")), { git: true })
|
it.instance("reject - does nothing for unknown requestID", () => rejectEffect(QuestionID.make("que_unknown")), {
|
||||||
|
git: true,
|
||||||
|
})
|
||||||
|
|
||||||
// multiple questions tests
|
// multiple questions tests
|
||||||
|
|
||||||
it.instance("ask - handles multiple questions", () =>
|
it.instance(
|
||||||
|
"ask - handles multiple questions",
|
||||||
|
() =>
|
||||||
Effect.gen(function* () {
|
Effect.gen(function* () {
|
||||||
const questions = [
|
const questions = [
|
||||||
{
|
{
|
||||||
@@ -276,7 +294,9 @@ it.instance("ask - handles multiple questions", () =>
|
|||||||
|
|
||||||
// list tests
|
// list tests
|
||||||
|
|
||||||
it.instance("list - returns all pending requests", () =>
|
it.instance(
|
||||||
|
"list - returns all pending requests",
|
||||||
|
() =>
|
||||||
Effect.gen(function* () {
|
Effect.gen(function* () {
|
||||||
const fiber1 = yield* askEffect({
|
const fiber1 = yield* askEffect({
|
||||||
sessionID: SessionID.make("ses_test1"),
|
sessionID: SessionID.make("ses_test1"),
|
||||||
@@ -309,7 +329,9 @@ it.instance("list - returns all pending requests", () =>
|
|||||||
{ git: true },
|
{ git: true },
|
||||||
)
|
)
|
||||||
|
|
||||||
it.instance("list - returns empty when no pending", () =>
|
it.instance(
|
||||||
|
"list - returns empty when no pending",
|
||||||
|
() =>
|
||||||
Effect.gen(function* () {
|
Effect.gen(function* () {
|
||||||
const pending = yield* listEffect
|
const pending = yield* listEffect
|
||||||
expect(pending.length).toBe(0)
|
expect(pending.length).toBe(0)
|
||||||
|
|||||||
Reference in New Issue
Block a user