mirror of
https://github.com/usebruno/bruno.git
synced 2025-06-26 23:11:32 +02:00
update natural to sequential (#2717)
This commit is contained in:
parent
6fe96a8194
commit
98c53cf443
@ -408,7 +408,7 @@ const registerNetworkIpc = (mainWindow) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// run post-response script
|
// run post-response script
|
||||||
const responseScript = compact(scriptingConfig.flow === 'natural' ? [
|
const responseScript = compact(scriptingConfig.flow === 'sequential' ? [
|
||||||
get(collectionRoot, 'request.script.res'), get(request, 'script.res')
|
get(collectionRoot, 'request.script.res'), get(request, 'script.res')
|
||||||
] : [
|
] : [
|
||||||
get(request, 'script.res'), get(collectionRoot, 'request.script.res')
|
get(request, 'script.res'), get(collectionRoot, 'request.script.res')
|
||||||
@ -596,7 +596,7 @@ const registerNetworkIpc = (mainWindow) => {
|
|||||||
|
|
||||||
// run tests
|
// run tests
|
||||||
const testScript = item.draft ? get(item.draft, 'request.tests') : get(item, 'request.tests');
|
const testScript = item.draft ? get(item.draft, 'request.tests') : get(item, 'request.tests');
|
||||||
const testFile = compact(scriptingConfig.flow === 'natural' ? [
|
const testFile = compact(scriptingConfig.flow === 'sequential' ? [
|
||||||
get(collectionRoot, 'request.tests'), testScript,
|
get(collectionRoot, 'request.tests'), testScript,
|
||||||
] : [
|
] : [
|
||||||
testScript, get(collectionRoot, 'request.tests')
|
testScript, get(collectionRoot, 'request.tests')
|
||||||
@ -1036,7 +1036,7 @@ const registerNetworkIpc = (mainWindow) => {
|
|||||||
|
|
||||||
// run tests
|
// run tests
|
||||||
const testScript = item.draft ? get(item.draft, 'request.tests') : get(item, 'request.tests');
|
const testScript = item.draft ? get(item.draft, 'request.tests') : get(item, 'request.tests');
|
||||||
const testFile = compact(scriptingConfig.flow === 'natural' ? [
|
const testFile = compact(scriptingConfig.flow === 'sequential' ? [
|
||||||
get(collectionRoot, 'request.tests'), testScript
|
get(collectionRoot, 'request.tests'), testScript
|
||||||
] : [
|
] : [
|
||||||
testScript, get(collectionRoot, 'request.tests')
|
testScript, get(collectionRoot, 'request.tests')
|
||||||
|
@ -147,7 +147,7 @@ const mergeFolderLevelScripts = (request, requestTreePath, scriptFlow) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (folderCombinedPostResScript.length) {
|
if (folderCombinedPostResScript.length) {
|
||||||
if (scriptFlow === 'natural') {
|
if (scriptFlow === 'sequential') {
|
||||||
request.script.res = compact([...folderCombinedPostResScript, request?.script?.res || '']).join(os.EOL);
|
request.script.res = compact([...folderCombinedPostResScript, request?.script?.res || '']).join(os.EOL);
|
||||||
} else {
|
} else {
|
||||||
request.script.res = compact([request?.script?.res || '', ...folderCombinedPostResScript.reverse()]).join(os.EOL);
|
request.script.res = compact([request?.script?.res || '', ...folderCombinedPostResScript.reverse()]).join(os.EOL);
|
||||||
@ -155,7 +155,7 @@ const mergeFolderLevelScripts = (request, requestTreePath, scriptFlow) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (folderCombinedTests.length) {
|
if (folderCombinedTests.length) {
|
||||||
if (scriptFlow === 'natural') {
|
if (scriptFlow === 'sequential') {
|
||||||
request.tests = compact([...folderCombinedTests, request?.tests || '']).join(os.EOL);
|
request.tests = compact([...folderCombinedTests, request?.tests || '']).join(os.EOL);
|
||||||
} else {
|
} else {
|
||||||
request.tests = compact([request?.tests || '', ...folderCombinedTests.reverse()]).join(os.EOL);
|
request.tests = compact([request?.tests || '', ...folderCombinedTests.reverse()]).join(os.EOL);
|
||||||
@ -309,7 +309,7 @@ const prepareRequest = (item, collection) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// scriptFlow is either "sandwich" or "natural"
|
// scriptFlow is either "sandwich" or "sequential"
|
||||||
const scriptFlow = collection.brunoConfig?.scripts?.flow ?? 'sandwich';
|
const scriptFlow = collection.brunoConfig?.scripts?.flow ?? 'sandwich';
|
||||||
const requestTreePath = getTreePathFromCollectionToItem(collection, item);
|
const requestTreePath = getTreePathFromCollectionToItem(collection, item);
|
||||||
if (requestTreePath && requestTreePath.length > 0) {
|
if (requestTreePath && requestTreePath.length > 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user