mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-05 10:12:41 +00:00
Fix test
This commit is contained in:
@@ -125,7 +125,7 @@ describe('Tests for api', ()=>{
|
|||||||
|
|
||||||
describe('getBrew', ()=>{
|
describe('getBrew', ()=>{
|
||||||
const toBrewPromise = (brew)=>new Promise((res)=>res({ toObject: ()=>brew }));
|
const toBrewPromise = (brew)=>new Promise((res)=>res({ toObject: ()=>brew }));
|
||||||
const notFoundError = 'Brew not found in Homebrewery database or Google Drive';
|
const notFoundError = { HBErrorCode: '04', message: 'Brew not found', name: 'BrewLoad Error', status: 404 };
|
||||||
|
|
||||||
it('returns middleware', ()=>{
|
it('returns middleware', ()=>{
|
||||||
const getFn = api.getBrew('share');
|
const getFn = api.getBrew('share');
|
||||||
@@ -162,7 +162,7 @@ describe('Tests for api', ()=>{
|
|||||||
err = e;
|
err = e;
|
||||||
}
|
}
|
||||||
|
|
||||||
expect(err).toEqual({ 'message': notFoundError });
|
expect(err).toEqual(notFoundError);
|
||||||
expect(req.brew).toEqual({});
|
expect(req.brew).toEqual({});
|
||||||
expect(next).not.toHaveBeenCalled();
|
expect(next).not.toHaveBeenCalled();
|
||||||
expect(api.getId).toHaveBeenCalledWith(req);
|
expect(api.getId).toHaveBeenCalledWith(req);
|
||||||
|
|||||||
Reference in New Issue
Block a user