mirror of
https://github.com/usebruno/bruno.git
synced 2025-01-25 07:08:45 +01:00
29 lines
911 B
Plaintext
29 lines
911 B
Plaintext
meta {
|
|
name: js
|
|
}
|
|
|
|
headers {
|
|
folder-header: folder-header-value
|
|
}
|
|
|
|
script:pre-request {
|
|
// used by `scripting/js/folder-collection script-tests`
|
|
const shouldTestFolderScripts = bru.getVar('should-test-folder-scripts');
|
|
if(shouldTestFolderScripts) {
|
|
bru.setVar('folder-var-set-by-folder-script', 'folder-var-value-set-by-folder-script');
|
|
}
|
|
}
|
|
|
|
tests {
|
|
// used by `scripting/js/folder-collection script-tests`
|
|
const shouldTestFolderScripts = bru.getVar('should-test-folder-scripts');
|
|
const folderVar = bru.getVar("folder-var-set-by-folder-script");
|
|
if (shouldTestFolderScripts && folderVar) {
|
|
test("folder level test - should get the var that was set by the folder script", function() {
|
|
expect(folderVar).to.equal("folder-var-value-set-by-folder-script");
|
|
});
|
|
bru.setVar('folder-var-set-by-folder-script', null);
|
|
bru.setVar('should-test-folder-scripts', null);
|
|
}
|
|
}
|