-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EPMRPP-89644 || Implement attachments support (#14)
* EPMRPP-89644 || Implement attachments support * EPMRPP-89644 || Update changelog * EPMRPP-89644 || Fix lint errors * EPMRPP-89644 || Fix lint errors * EPMRPP-89644 || Add description support for attach log * EPMRPP-89644 || Fix lint errors * EPMRPP-89644 || Code Review fixes - 1 * EPMRPP-89644 || Code Review fixes - 1 (fix lint errors) * EPMRPP-89644 || Code Review fixes - 2
- Loading branch information
1 parent
944e183
commit 2b0e273
Showing
9 changed files
with
106 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
### Added | ||
- ReportingApi with attachment support | ||
|
||
## [5.0.0] - 2024-02-15 | ||
### Added | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import * as vitest from 'vitest'; | ||
import * as Models from './models'; | ||
import { isRPTaskMeta } from './utils'; | ||
|
||
const injectRPTaskMeta = (task: vitest.Task) => { | ||
if (isRPTaskMeta(task.meta)) { | ||
return; | ||
} | ||
|
||
(task.meta as Models.RPTaskMeta) = { | ||
...task.meta, | ||
rpMeta: { | ||
test: { | ||
logs: [], | ||
}, | ||
}, | ||
}; | ||
}; | ||
|
||
const attachment = (task: vitest.Task, data: Models.Attachment, description?: string) => { | ||
injectRPTaskMeta(task); | ||
(task.meta as Models.RPTaskMeta).rpMeta.test.logs.push({ | ||
file: data, | ||
time: Date.now(), | ||
message: description || data.name, | ||
}); | ||
}; | ||
|
||
export const ReportingApi: Models.ReportingApi = { | ||
attachment, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters