mirror of
https://github.com/usebruno/bruno.git
synced 2024-11-28 19:03:15 +01:00
35 lines
791 B
JavaScript
35 lines
791 B
JavaScript
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'
|
|
}
|
|
]
|
|
});
|
|
});
|
|
});
|