aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sra-report/src
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2018-02-28 09:12:45 +0800
committerBrandon Millman <brandon.millman@gmail.com>2018-02-28 09:12:45 +0800
commit0987c9a7cfb1936469062b4cb6222158b5e110b7 (patch)
tree28c48558dfecac778dae881bd3a9cd34bc7a989c /packages/sra-report/src
parente48a3edacba891a18e641e01708e3d73fd6588ac (diff)
downloaddexon-sol-tools-0987c9a7cfb1936469062b4cb6222158b5e110b7.tar
dexon-sol-tools-0987c9a7cfb1936469062b4cb6222158b5e110b7.tar.gz
dexon-sol-tools-0987c9a7cfb1936469062b4cb6222158b5e110b7.tar.bz2
dexon-sol-tools-0987c9a7cfb1936469062b4cb6222158b5e110b7.tar.lz
dexon-sol-tools-0987c9a7cfb1936469062b4cb6222158b5e110b7.tar.xz
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.ts20
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);