File tree Expand file tree Collapse file tree 6 files changed +11
-7
lines changed
packages/bruno-tests/collection Expand file tree Collapse file tree 6 files changed +11
-7
lines changed Original file line number Diff line number Diff line change 16
16
foo: bar
17
17
testSetEnvVar: bruno-29653
18
18
echo-host: https://echo.usebruno.com
19
+ env_name: Local
20
+ test_get_env_var_key1: foo
19
21
client_id: client_id_1
20
22
client_secret: client_secret_1
21
23
auth_url: http://localhost:8080/api/auth/oauth2/authorization_code/authorize
Original file line number Diff line number Diff line change 16
16
foo: bar
17
17
testSetEnvVar: bruno-29653
18
18
echo-host: https://echo.usebruno.com
19
+ env_name: Prod
20
+ test_get_env_var_key1: foo
19
21
}
Original file line number Diff line number Diff line change @@ -18,6 +18,6 @@ script:pre-request {
18
18
tests {
19
19
test("should get env name in scripts", function() {
20
20
const testEnvName = bru.getVar("testEnvName");
21
- expect(testEnvName).to.equal("Prod" );
21
+ expect(testEnvName).to.equal(bru.getEnvVar("env_name") );
22
22
});
23
23
}
Original file line number Diff line number Diff line change 10
10
auth: none
11
11
}
12
12
13
-
14
13
tests {
15
14
test("should get env var in scripts", function() {
16
- const host = bru.getEnvVar("host ")
17
- expect(host).to.equal("https://testbench-sanity.usebruno.com ");
15
+ const host = bru.getEnvVar("test_get_env_var_key1 ")
16
+ expect(host).to.equal("foo ");
18
17
});
19
- }
18
+ }
Original file line number Diff line number Diff line change @@ -18,6 +18,6 @@ assert {
18
18
tests {
19
19
test("req.getUrl()", function() {
20
20
const url = req.getUrl();
21
- expect(url).to.equal("https://testbench-sanity.usebruno.com /ping");
21
+ expect(url).to.equal(bru.getEnvVar("host") + " /ping");
22
22
});
23
23
}
Original file line number Diff line number Diff line change @@ -33,7 +33,8 @@ tests {
33
33
test("res.getResponseTime()", function() {
34
34
const responseTime = res.getResponseTime();
35
35
expect(typeof responseTime).to.eql("number");
36
- expect(responseTime > 0).to.be.true;
36
+ expect(responseTime >= 0).to.be.true;
37
+ // 0ms is possible in with local server and CLI run
37
38
});
38
39
39
40
}
You can’t perform that action at this time.
0 commit comments