mockyeah-cli
Advanced tools
Comparing version 0.18.4 to 0.19.0
@@ -27,4 +27,6 @@ 'use strict'; | ||
.option('-o, --only <regex>', 'only record calls to URLs matching given regex pattern') | ||
.option('-h, --use-headers', 'record headers to response options') | ||
.option('-l, --use-latency', 'record latency to response options') | ||
.option( | ||
'-h, --header <line>', | ||
'-H, --header <line>', | ||
'record matches will require these headers ("Name: Value")', | ||
@@ -37,2 +39,7 @@ collect, | ||
const recordStopCallback = err => { | ||
if (err) console.error(err); | ||
process.exit(err ? 1 : 0); | ||
}; | ||
const withName = (env, name, options = {}) => { | ||
@@ -68,9 +75,6 @@ const { adminUrl } = env; | ||
if (remote) { | ||
request.get(`${adminUrl}/record-stop`, () => {}); | ||
request.get(`${adminUrl}/record-stop`, recordStopCallback); | ||
} else { | ||
// eslint-disable-next-line global-require, import/no-dynamic-require | ||
require(env.modulePath).recordStop(err => { | ||
if (err) console.error(err); | ||
process.exit(err ? 1 : 0); | ||
}); | ||
require(env.modulePath).recordStop(recordStopCallback); | ||
} | ||
@@ -87,3 +91,3 @@ } | ||
const [name] = program.args; | ||
const { only, header } = program; | ||
const { only, header, useHeaders, useLatency } = program; | ||
@@ -94,3 +98,5 @@ env.program = program; | ||
only, | ||
headers: header | ||
headers: header, | ||
useHeaders, | ||
useLatency | ||
}; | ||
@@ -97,0 +103,0 @@ |
{ | ||
"name": "mockyeah-cli", | ||
"version": "0.18.4", | ||
"version": "0.19.0", | ||
"description": "A powerful service mocking, recording, and playback utility.", | ||
@@ -27,3 +27,3 @@ "main": "index.js", | ||
"devDependencies": { | ||
"mockyeah": "^0.18.4" | ||
"mockyeah": "^0.19.0" | ||
}, | ||
@@ -33,3 +33,3 @@ "engines": { | ||
}, | ||
"gitHead": "91aebe566a09d77e9a4299957bbe972b43f5f680" | ||
"gitHead": "22fbf7bcd4f2e41d282cd9c324a150caf33ab7c2" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12502
18
339