@fakes/media-devices
Version:
A interactive fake implementation of MediaDevices interface in the browser for testing
27 lines (21 loc) • 543 B
text/typescript
export interface Reporter {
notImplemented(message: string): void
report(producer: () => string[]): void
}
export class NoopReporter implements Reporter {
notImplemented(message: string): void {
// do nothing
}
report(producer: () => string[]): void {
// do nothing
}
}
export class DefaultReporter implements Reporter {
notImplemented(message: string): void {
console.log('mdf', '💥', message)
}
report(producer: () => string[]): void {
const parts = producer()
console.log('mdf', ...parts)
}
}