lmarqs/cypress-rollup-preprocessor

View on GitHub
src/error.ts

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import { EOL } from 'os'

export function wrapRollupError (rollupError: any): any {
  const message = [
    rollupError.message,
    rollupError.frame,
    [rollupError.loc?.file, rollupError.loc?.line, rollupError.loc?.column]
    .filter(Boolean)
    .join(':'),
  ]
  .filter(Boolean)
  .join(EOL)

  return new Error(message)
}