diff options
author | Brandon Millman <brandon.millman@gmail.com> | 2018-02-28 09:12:45 +0800 |
---|---|---|
committer | Brandon Millman <brandon.millman@gmail.com> | 2018-02-28 09:12:45 +0800 |
commit | 0987c9a7cfb1936469062b4cb6222158b5e110b7 (patch) | |
tree | 28c48558dfecac778dae881bd3a9cd34bc7a989c /packages/sra-report/src | |
parent | e48a3edacba891a18e641e01708e3d73fd6588ac (diff) | |
download | dexon-sol-tools-0987c9a7cfb1936469062b4cb6222158b5e110b7.tar.gz dexon-sol-tools-0987c9a7cfb1936469062b4cb6222158b5e110b7.tar.zst dexon-sol-tools-0987c9a7cfb1936469062b4cb6222158b5e110b7.zip |
Write to provided output directory
Diffstat (limited to 'packages/sra-report/src')
-rw-r--r-- | packages/sra-report/src/index.ts | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/packages/sra-report/src/index.ts b/packages/sra-report/src/index.ts index bd0615480..fade07095 100644 --- a/packages/sra-report/src/index.ts +++ b/packages/sra-report/src/index.ts @@ -63,13 +63,27 @@ const mainAsync = async () => { throw new Error('Could not get any orders from /orders endpoint'); } const orderHash = ZeroEx.getOrderHashHex(firstOrder); - const newmanRunOptions = { + const newmanEnvironmentOptions = { collection: sraReportCollectionJSON, - reporters: 'cli', globals: postmanEnvironmentFactory.createGlobalEnvironment(args.url, orderHash), environment: postmanEnvironmentFactory.createNetworkEnvironment(args.networkId), }; + const newmanReporterOptions = !_.isUndefined(args.output) + ? { + reporters: 'json', + reporter: { + json: { + export: args.output, + }, + }, + } + : { + reporters: 'cli', + }; + const newmanRunOptions = { + ...newmanEnvironmentOptions, + ...newmanReporterOptions, + }; await newmanRunAsync(newmanRunOptions); }; - mainAsync().catch(utils.log); |