Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export async function script1({items}: {
- items: {
- pass: boolean;
- name: string;
- error?: string;
- estimate?: string;
- }[];
- }): Promise<{
- pass: boolean;
- report: string;
- }> {
- return {
- pass: items.reduce((all, {pass}) => all && pass, true),
- report: items.map(item => {
- if (item.pass) {
- return `OK ${item.name}`;
- }
- return `NOT OK ${item.name}${item.error ? `\n${item.error}\n` : ''}${item.estimate ? `\Expected time to resolution: ${item.estimate}\n\n` : ''}`;
- }).join('\n')
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement