Skip to content

Commit

Permalink
increase coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
umutozel committed Sep 25, 2018
1 parent ee383ea commit e39210b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
21 changes: 21 additions & 0 deletions test/ajax.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,25 @@ describe('Ajax helper tests', () => {

expect(o).property('url').to.equal('List');
});

it('should branch to all paths', () => {
const o1: AjaxOptions = {
method: 'GET',
url: 'Companies',
timeout: 1000
};
const o2: AjaxOptions = {
data: { id: 1 },
headers: { "AUTH": "42" }
};

expect(mergeAjaxOptions(o1, o2)).to.deep.equal({
method: 'GET',
url: 'Companies',
timeout: 1000,
data: { id: 1 },
headers: { "AUTH": "42" },
params: []
});
});
});
5 changes: 1 addition & 4 deletions test/query-part.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ describe('Query part tests', () => {
const classOrders = [orders[0], orders[2], orders[4]].asQueryable().cast<Order>(Order).toArray();
expect(classOrders).to.deep.equal([orders[0], orders[2], orders[4]]);

const extendedOrders = [new ExtendedOrder(1, '2', 3, new Date(), null, [])];
const query: IQuery<Order> = extendedOrders.asQueryable();
const result = query.cast<ExtendedOrder>(ExtendedOrder).toArray();
expect(extendedOrders).to.deep.equal(result);
expect(() => orders.asQueryable().cast<ExtendedOrder>(ExtendedOrder).toArray()).to.throw();

expect([null].asQueryable().cast<Number>(Number).toArray()).to.deep.equal([null]);

Expand Down

0 comments on commit e39210b

Please sign in to comment.