Skip to content

Commit

Permalink
Improved tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bhunjadi committed Oct 25, 2023
1 parent c1ba174 commit 6a559c0
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions lib/query/testing/server.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1297,14 +1297,26 @@ describe("Hypernova", function() {
},
}).fetch();

// console.log('result', JSON.stringify(result));

expect(result).to.be.an("array");
expect(result).to.have.length(2);

result.forEach(file => {
expect(file.metas).to.be.an('array');
expect(file.metas[0].manyProjects).to.be.an('array');
if (file.filename === 'test.txt') {
expect(file.metas).to.be.an('array').and.have.length(2);
expect(file.metas[0].manyProjects.map((p) => ({
name: p.name
}))).to.be.eql([
{
name: 'Project 1'
}
]);
expect(file.metas[1].manyProjects).to.have.length(2);
}
// invoice.pdf file
else {
expect(file.metas).to.be.an('array').and.have.length(1);
expect(file.metas[0].manyProjects).to.be.an('array').and.have.length(0);
}
});
});

Expand Down

0 comments on commit 6a559c0

Please sign in to comment.