mirror of
https://github.com/usebruno/bruno.git
synced 2025-01-11 00:18:46 +01:00
chore: restructure bru js package
This commit is contained in:
parent
827c480689
commit
c8de57aa51
@ -37,6 +37,8 @@ const bruToJson = (bru) => {
|
|||||||
"params": _.get(json, "query", []),
|
"params": _.get(json, "query", []),
|
||||||
"headers": _.get(json, "headers", []),
|
"headers": _.get(json, "headers", []),
|
||||||
"body": _.get(json, "body", {}),
|
"body": _.get(json, "body", {}),
|
||||||
|
"vars": _.get(json, "vars", []),
|
||||||
|
"assert": _.get(json, "assert", []),
|
||||||
"script": _.get(json, "script", ""),
|
"script": _.get(json, "script", ""),
|
||||||
"tests": _.get(json, "tests", "")
|
"tests": _.get(json, "tests", "")
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,9 @@ const runSingleRequest = async function (filename, collectionPath, collectionVar
|
|||||||
testResults = get(result, 'results', []);
|
testResults = get(result, 'results', []);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(chalk.blue(stripExtension(filename)) + chalk.dim(` (${response.status} ${response.statusText})`));
|
console.log(JSON.stringify(bruJson, null, 2));
|
||||||
|
|
||||||
|
console.log(chalk.green(stripExtension(filename)) + chalk.dim(` (${response.status} ${response.statusText})`));
|
||||||
if(testResults && testResults.length) {
|
if(testResults && testResults.length) {
|
||||||
each(testResults, (testResult) => {
|
each(testResults, (testResult) => {
|
||||||
if(testResult.status === 'pass') {
|
if(testResult.status === 'pass') {
|
||||||
|
@ -8,5 +8,8 @@
|
|||||||
],
|
],
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"vm2": "^3.9.13"
|
"vm2": "^3.9.13"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"json-query": "^2.2.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
const {
|
const {
|
||||||
ScriptRuntime
|
ScriptRuntime
|
||||||
} = require('./scripts/script-runtime');
|
} = require('./script-runtime');
|
||||||
|
|
||||||
const {
|
const {
|
||||||
TestRuntime
|
TestRuntime
|
||||||
} = require('./scripts/test-runtime');
|
} = require('./test-runtime');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
ScriptRuntime,
|
ScriptRuntime,
|
||||||
|
Loading…
Reference in New Issue
Block a user