chore: generate
This commit is contained in:
@@ -150,7 +150,9 @@ function ready(directory: string) {
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
describeWatcher("FileWatcher", () => {
|
describeWatcher("FileWatcher", () => {
|
||||||
it.instance("publishes root create, update, and delete events", () =>
|
it.instance(
|
||||||
|
"publishes root create, update, and delete events",
|
||||||
|
() =>
|
||||||
Effect.gen(function* () {
|
Effect.gen(function* () {
|
||||||
const test = yield* TestInstance
|
const test = yield* TestInstance
|
||||||
const fs = yield* AppFileSystem.Service
|
const fs = yield* AppFileSystem.Service
|
||||||
@@ -181,16 +183,16 @@ describeWatcher("FileWatcher", () => {
|
|||||||
|
|
||||||
yield* withWatcher(
|
yield* withWatcher(
|
||||||
test.directory,
|
test.directory,
|
||||||
nextUpdate(
|
nextUpdate(test.directory, (e) => e.file === file && e.event === "add", fs.writeFileString(file, "plain")).pipe(
|
||||||
test.directory,
|
Effect.tap((evt) => Effect.sync(() => expect(evt).toEqual({ file, event: "add" }))),
|
||||||
(e) => e.file === file && e.event === "add",
|
),
|
||||||
fs.writeFileString(file, "plain"),
|
|
||||||
).pipe(Effect.tap((evt) => Effect.sync(() => expect(evt).toEqual({ file, event: "add" })))),
|
|
||||||
)
|
)
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|
||||||
it.instance("cleanup stops publishing events", () =>
|
it.instance(
|
||||||
|
"cleanup stops publishing events",
|
||||||
|
() =>
|
||||||
Effect.gen(function* () {
|
Effect.gen(function* () {
|
||||||
const test = yield* TestInstance
|
const test = yield* TestInstance
|
||||||
const fs = yield* AppFileSystem.Service
|
const fs = yield* AppFileSystem.Service
|
||||||
@@ -207,7 +209,9 @@ describeWatcher("FileWatcher", () => {
|
|||||||
{ git: true },
|
{ git: true },
|
||||||
)
|
)
|
||||||
|
|
||||||
it.instance("ignores .git/index changes", () =>
|
it.instance(
|
||||||
|
"ignores .git/index changes",
|
||||||
|
() =>
|
||||||
Effect.gen(function* () {
|
Effect.gen(function* () {
|
||||||
const test = yield* TestInstance
|
const test = yield* TestInstance
|
||||||
const fs = yield* AppFileSystem.Service
|
const fs = yield* AppFileSystem.Service
|
||||||
@@ -227,7 +231,9 @@ describeWatcher("FileWatcher", () => {
|
|||||||
{ git: true },
|
{ git: true },
|
||||||
)
|
)
|
||||||
|
|
||||||
it.instance("publishes .git/HEAD events", () =>
|
it.instance(
|
||||||
|
"publishes .git/HEAD events",
|
||||||
|
() =>
|
||||||
Effect.gen(function* () {
|
Effect.gen(function* () {
|
||||||
const test = yield* TestInstance
|
const test = yield* TestInstance
|
||||||
const fs = yield* AppFileSystem.Service
|
const fs = yield* AppFileSystem.Service
|
||||||
|
|||||||
@@ -167,7 +167,11 @@ const trackBrowserOpenFailed = Effect.gen(function* () {
|
|||||||
const authenticateScoped = (name: string) =>
|
const authenticateScoped = (name: string) =>
|
||||||
Effect.gen(function* () {
|
Effect.gen(function* () {
|
||||||
const mcp = yield* service
|
const mcp = yield* service
|
||||||
yield* mcp.authenticate(name).pipe(Effect.ignore, Effect.catchCause(() => Effect.void), Effect.forkScoped)
|
yield* mcp.authenticate(name).pipe(
|
||||||
|
Effect.ignore,
|
||||||
|
Effect.catchCause(() => Effect.void),
|
||||||
|
Effect.forkScoped,
|
||||||
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
mcpTest.instance(
|
mcpTest.instance(
|
||||||
@@ -180,10 +184,7 @@ mcpTest.instance(
|
|||||||
const event = yield* trackBrowserOpenFailed
|
const event = yield* trackBrowserOpenFailed
|
||||||
yield* authenticateScoped("test-oauth-server")
|
yield* authenticateScoped("test-oauth-server")
|
||||||
|
|
||||||
const failure = yield* awaitWithTimeout(
|
const failure = yield* awaitWithTimeout(Deferred.await(event), "Timed out waiting for BrowserOpenFailed event")
|
||||||
Deferred.await(event),
|
|
||||||
"Timed out waiting for BrowserOpenFailed event",
|
|
||||||
)
|
|
||||||
|
|
||||||
expect(failure.mcpName).toBe("test-oauth-server")
|
expect(failure.mcpName).toBe("test-oauth-server")
|
||||||
expect(failure.url).toContain("https://")
|
expect(failure.url).toContain("https://")
|
||||||
|
|||||||
Reference in New Issue
Block a user