mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-30 16:14:06 +00:00
Fix failing test case when the selected env is Local
This commit is contained in:
@@ -16,6 +16,8 @@ vars {
|
||||
foo: bar
|
||||
testSetEnvVar: bruno-29653
|
||||
echo-host: https://echo.usebruno.com
|
||||
env_name: Local
|
||||
test_get_env_var_key1: foo
|
||||
client_id: client_id_1
|
||||
client_secret: client_secret_1
|
||||
auth_url: http://localhost:8080/api/auth/oauth2/authorization_code/authorize
|
||||
|
||||
@@ -16,4 +16,6 @@ vars {
|
||||
foo: bar
|
||||
testSetEnvVar: bruno-29653
|
||||
echo-host: https://echo.usebruno.com
|
||||
env_name: Prod
|
||||
test_get_env_var_key1: foo
|
||||
}
|
||||
|
||||
@@ -18,6 +18,6 @@ script:pre-request {
|
||||
tests {
|
||||
test("should get env name in scripts", function() {
|
||||
const testEnvName = bru.getVar("testEnvName");
|
||||
expect(testEnvName).to.equal("Prod");
|
||||
expect(testEnvName).to.equal(bru.getEnvVar("env_name"));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -10,10 +10,9 @@ get {
|
||||
auth: none
|
||||
}
|
||||
|
||||
|
||||
tests {
|
||||
test("should get env var in scripts", function() {
|
||||
const host = bru.getEnvVar("host")
|
||||
expect(host).to.equal("https://testbench-sanity.usebruno.com");
|
||||
const host = bru.getEnvVar("test_get_env_var_key1")
|
||||
expect(host).to.equal("foo");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,6 @@ assert {
|
||||
tests {
|
||||
test("req.getUrl()", function() {
|
||||
const url = req.getUrl();
|
||||
expect(url).to.equal("https://testbench-sanity.usebruno.com/ping");
|
||||
expect(url).to.equal(bru.getEnvVar("host") + "/ping");
|
||||
});
|
||||
}
|
||||
|
||||
@@ -33,7 +33,8 @@ tests {
|
||||
test("res.getResponseTime()", function() {
|
||||
const responseTime = res.getResponseTime();
|
||||
expect(typeof responseTime).to.eql("number");
|
||||
expect(responseTime > 0).to.be.true;
|
||||
expect(responseTime >= 0).to.be.true;
|
||||
// 0ms is possible in with local server and CLI run
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user