(project: TestProject, filepath: string, error: Error)
| 285 | } |
| 286 | |
| 287 | export function createFailedFileTask(project: TestProject, filepath: string, error: Error): File { |
| 288 | const testFilepath = relative(project.config.root, filepath) |
| 289 | const file: ParsedFile = { |
| 290 | filepath, |
| 291 | type: 'suite', |
| 292 | id: /* @__PURE__ */ generateHash(`${testFilepath}${project.config.name || ''}`), |
| 293 | name: testFilepath, |
| 294 | fullName: testFilepath, |
| 295 | mode: 'run', |
| 296 | tasks: [], |
| 297 | start: 0, |
| 298 | end: 0, |
| 299 | projectName: project.name, |
| 300 | meta: {}, |
| 301 | pool: project.browser ? 'browser' : project.config.pool, |
| 302 | file: null!, |
| 303 | result: { |
| 304 | state: 'fail', |
| 305 | errors: serializeError(project, error), |
| 306 | }, |
| 307 | } |
| 308 | file.file = file |
| 309 | return file |
| 310 | } |
| 311 | |
| 312 | function serializeError(ctx: TestProject, error: any): TestError[] { |
| 313 | if ('errors' in error && 'pluginCode' in error) { |
no test coverage detected