@@ -2,6 +2,7 @@ import { CloudFormationClient } from '@aws-sdk/client-cloudformation'
22import { SSMClient } from '@aws-sdk/client-ssm'
33import { runFolder } from '@nordicsemiconductor/bdd-markdown'
44import { stackOutput } from '@nordicsemiconductor/cloudformation-helpers'
5+ import chalk from 'chalk'
56import path from 'node:path'
67import type { StackOutputs } from '../cdk/RegistryStack.js'
78import { STACK_NAME } from '../cdk/stackConfig.js'
@@ -16,14 +17,33 @@ export type World = {
1617 stackName : string
1718} & Record < string , any >
1819
20+ const print = ( arg : unknown ) =>
21+ typeof arg === 'object' ? JSON . stringify ( arg ) : arg
22+
1923const runner = await runFolder < World > ( {
2024 folder : path . join ( process . cwd ( ) , 'features' ) ,
2125 name : 'Public Parameter Registry' ,
2226 logObserver : {
23- onDebug : console . debug ,
24- onError : console . error ,
25- onInfo : console . log ,
26- onProgress : console . debug ,
27+ onDebug : ( info , ...args ) =>
28+ console . error (
29+ chalk . magenta ( info . context . keyword ) ,
30+ ...args . map ( ( arg ) => chalk . cyan ( print ( arg ) ) ) ,
31+ ) ,
32+ onError : ( info , ...args ) =>
33+ console . error (
34+ chalk . magenta ( info . context . keyword ) ,
35+ ...args . map ( ( arg ) => chalk . red ( print ( arg ) ) ) ,
36+ ) ,
37+ onInfo : ( info , ...args ) =>
38+ console . error (
39+ chalk . magenta ( info . context . keyword ) ,
40+ ...args . map ( ( arg ) => chalk . green ( print ( arg ) ) ) ,
41+ ) ,
42+ onProgress : ( info , ...args ) =>
43+ console . error (
44+ chalk . magenta ( info . context . keyword ) ,
45+ ...args . map ( ( arg ) => chalk . yellow ( print ( arg ) ) ) ,
46+ ) ,
2747 } ,
2848} )
2949
0 commit comments