All files / base test-polyfill.tsx

63.64% Statements 7/11
75% Branches 6/8
25% Functions 1/4
63.64% Lines 7/11

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36  4x 2x 2x   2x         2x                           2x             2x        
export default () => {
  if ((global as any)['window']) {
    const hyperform = require('hyperform');
    hyperform(window);
 
    Object.defineProperty((window as any)['HTMLElement'].prototype, 'dataset', {
      writable: true,
      value: {}
    });
 
    Iif (!(window as any)['HTMLCanvasElement']) {
      Object.defineProperty(
        (window as any)['HTMLCanvasElement'].prototype,
        'getContext',
        {
          writable: true,
          value: () => ({
            font: '',
            measureText: () => ({ width: 0 })
          })
        }
      );
    }
 
    Iif (!(window as any).scrollTo) {
      Object.defineProperty(window as any, 'scrollTo', {
        writable: true,
        value: () => {}
      });
    }
 
    (window as any)['MutationObserver'] =
      (window as any)['MutationObserver'] || require('mutation-observer');
  }
};