feat(#119): bearer auth support completed

This commit is contained in:
Anoop M D
2023-10-04 00:36:52 +05:30
parent 2e600838b2
commit 48e4e60696
14 changed files with 134 additions and 36 deletions

View File

@ -34,6 +34,11 @@ const jsonToBru = (json) => {
body: ${http.body}`;
}
if (http.auth && http.auth.length) {
bru += `
auth: ${http.auth}`;
}
bru += `
}

View File

@ -7,6 +7,7 @@ meta {
get {
url: https://api.textlocal.in/send
body: json
auth: bearer
}
query {

View File

@ -7,7 +7,8 @@
"http": {
"method": "get",
"url": "https://api.textlocal.in/send",
"body": "json"
"body": "json",
"auth": "bearer"
},
"query": [
{

View File

@ -14,7 +14,7 @@ describe('bruToJson', () => {
});
describe('jsonToBru', () => {
it('should parse the bru file', () => {
it('should parse the json file', () => {
const input = require('./fixtures/request.json');
const expected = fs.readFileSync(path.join(__dirname, 'fixtures', 'request.bru'), 'utf8');
const output = jsonToBru(input);