| 131 | // is an object literal and cannot notice; a provider written as a class — exactly |
| 132 | // what "wrap any provider" invites — throws TypeError on the first optional call. |
| 133 | class ClassProvider { |
| 134 | readonly key = STORE; |
| 135 | readonly writable = true; |
| 136 | private readonly items = new Map<string, string>(); |
| 137 | get(id: ProviderItemId) { |
| 138 | return Effect.sync(() => this.items.get(String(id)) ?? null); |
| 139 | } |
| 140 | set(id: ProviderItemId, value: string) { |
| 141 | // `this` is the whole point: bare invocation makes this line throw. |
| 142 | return Effect.sync(() => void this.items.set(String(id), value)); |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | const executor = yield* createExecutor( |
| 147 | makeTestConfig({ plugins: [plugin(new ClassProvider() as CredentialProvider)] as const }), |
nothing calls this directly
no outgoing calls
no test coverage detected