import { ContextMock } from './context.mock' ; export class CanvasMock implements Partial < HTMLCanvasElement > { private readonly _context = new ContextMock ( this as unknown as HTMLCanvasElement ) ; width = 30 ; height = 30 ; getContext ( contextId , contextAttributes ? ) ; getContext ( contextId , contextAttributes ? ) ; getContext ( _contextId , _contextAttributes ? ) { return this . _context as unknown as CanvasRenderingContext2D ; } }