All files StrykerError.ts

100% Statements 8/8
50% Branches 2/4
100% Functions 2/2
100% Lines 7/7

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 111x   1x 2x 2x 2x   2x   1x  
import { errorToString } from './errors';
 
export default class StrykerError extends Error {
  constructor(message: string, readonly innerError?: Error) {
    super(`${message}${innerError ? `. Inner error: ${errorToString(innerError)}` : ''}`);
    Error.captureStackTrace(this, StrykerError);
    // TS recommendation: https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work
    Object.setPrototypeOf(this, StrykerError.prototype);
  }
}