Comparing version 0.1.4 to 0.1.5
{ | ||
"name": "okoze", | ||
"description": "Okoze is stub server that returns a response using a snapshot of the real server's response.", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"repository": "https://github.com/mya-ake/okoze.git", | ||
@@ -6,0 +6,0 @@ "bugs": { |
@@ -16,3 +16,3 @@ "use strict"; | ||
app.use(bodyParser.json()); | ||
if (process.env.DEBUG === 'true') { | ||
if (process.env.OKOZE_DEBUG === 'true') { | ||
app.use(loggerMiddleWare_1.buildLoggerMiddleware({ baseURL })); | ||
@@ -19,0 +19,0 @@ } |
@@ -9,2 +9,3 @@ "use strict"; | ||
const object_hash_1 = __importDefault(require("object-hash")); | ||
const consola_1 = __importDefault(require("consola")); | ||
const file_1 = require("./../lib/file"); | ||
@@ -30,3 +31,15 @@ const createSnapshotPathname = ({ method, url, }) => { | ||
}; | ||
const { status, data, headers: responseHeaders } = await request(axiosConfig).catch(err => err.response || {}); | ||
const { status, data, headers: responseHeaders } = await request(axiosConfig) | ||
.then(response => { | ||
if (process.env.OKOZE_DEBUG === 'true') { | ||
consola_1.default.debug(response); | ||
} | ||
return response; | ||
}) | ||
.catch(err => { | ||
if (process.env.OKOZE_DEBUG === 'true') { | ||
consola_1.default.debug(err); | ||
} | ||
return err.response || {}; | ||
}); | ||
await file_1.wrightFile(snapshotPathname, { | ||
@@ -45,3 +58,3 @@ status, | ||
exports.buildProcessor = (options) => { | ||
const { update, origin: baseURL, snapshotDir } = options; | ||
const { origin: baseURL, snapshotDir } = options; | ||
const request = axios_1.default.create({ | ||
@@ -48,0 +61,0 @@ baseURL, |
{ | ||
"name": "okoze", | ||
"description": "Okoze is stub server that returns a response using a snapshot of the real server's response.", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"repository": "https://github.com/mya-ake/okoze.git", | ||
@@ -6,0 +6,0 @@ "bugs": { |
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
17370
355
10