Skip to content

Commit

Permalink
Newman: filename fix (#187)
Browse files Browse the repository at this point in the history
* newman: fix filename

* fix unit test
  • Loading branch information
olexandr13 authored Oct 18, 2024
1 parent b969b09 commit 2da181a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/lib/frameworks/newman.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module.exports = (ast = '', file = '', source = '') => {

requests.push({
code,
_file: file,
file,
name: item.name,
suites,
});
Expand Down
8 changes: 4 additions & 4 deletions tests/newman_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ const fs = require('fs');
const { expect } = require('chai');
const newmanParser = require('../src/lib/frameworks/newman');

const source = fs.readFileSync('./example/newman/collection.json').toString();
const filename = 'collection.json';
const source = fs.readFileSync(`./example/newman/${filename}`).toString();

describe('newman parser', () => {
it('should parse newman collection', () => {
const tests = newmanParser(null, '', source);
const tests = newmanParser(null, filename, source);
expect(tests[0]).to.include.key('code');
expect(tests[0]).not.to.include.key('file');
expect(tests[0]).to.include.key('_file');
expect(tests[0]).to.include.key('file');
expect(tests[0]).to.include.key('name');
expect(tests[0]).to.include.key('suites');
expect(tests.length).to.equal(4);
Expand Down

0 comments on commit 2da181a

Please sign in to comment.