mirror of
https://github.com/usebruno/bruno.git
synced 2025-08-14 17:18:28 +02:00
refactor: organized v1 and v2 versions inside bru-lang
This commit is contained in:
33
packages/bruno-lang/v1/tests/bru-to-env-json.spec.js
Normal file
33
packages/bruno-lang/v1/tests/bru-to-env-json.spec.js
Normal file
@ -0,0 +1,33 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const {
|
||||
bruToEnvJson
|
||||
} = require('../src');
|
||||
|
||||
describe('bruToEnvJson', () => {
|
||||
it('should parse .bru file contents', () => {
|
||||
const requestFile = fs.readFileSync(path.join(__dirname, 'fixtures', 'env.bru'), 'utf8');
|
||||
const result = bruToEnvJson(requestFile);
|
||||
|
||||
expect(result).toEqual({
|
||||
"variables": [{
|
||||
"enabled": true,
|
||||
"name": "host",
|
||||
"value": "https://www.google.com",
|
||||
"type": "text"
|
||||
}, {
|
||||
"enabled": true,
|
||||
"name": "jwt",
|
||||
"value": "secret",
|
||||
"type": "text"
|
||||
}, {
|
||||
"enabled": false,
|
||||
"name": "Content-type",
|
||||
"value": "application/json",
|
||||
"type": "text"
|
||||
}]
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user