Skip to content

Commit

Permalink
fix tests for bruno-electron & bruno-lang (usebruno#2410)
Browse files Browse the repository at this point in the history
  • Loading branch information
lohxt1 authored and jwetzell committed Aug 2, 2024
1 parent a0a4ac2 commit 9d7ccbb
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const interpolateVars = (request, envVars = {}, collectionVariables = {}, proces
param.value = _interpolate(param.value);
});

if (request.params.length) {
if (request?.params?.length) {
let url = request.url;

if (!url.startsWith('http://') && !url.startsWith('https://')) {
Expand Down
8 changes: 6 additions & 2 deletions packages/bruno-lang/v2/tests/fixtures/request.bru
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,21 @@ meta {
}

get {
url: https://api.textlocal.in/send
url: https://api.textlocal.in/send/:id
body: json
auth: bearer
}

query {
params:query {
apiKey: secret
numbers: 998877665
~message: hello
}

params:path {
id: 123
}

headers {
content-type: application/json
Authorization: Bearer 123
Expand Down
13 changes: 11 additions & 2 deletions packages/bruno-lang/v2/tests/fixtures/request.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,34 @@
},
"http": {
"method": "get",
"url": "https://api.textlocal.in/send",
"url": "https://api.textlocal.in/send/:id",
"body": "json",
"auth": "bearer"
},
"query": [
"params": [
{
"name": "apiKey",
"value": "secret",
"type": "query",
"enabled": true
},
{
"name": "numbers",
"value": "998877665",
"type": "query",
"enabled": true
},
{
"name": "message",
"value": "hello",
"type": "query",
"enabled": false
},
{
"name": "id",
"value": "123",
"type": "path",
"enabled": true
}
],
"headers": [
Expand Down

0 comments on commit 9d7ccbb

Please sign in to comment.