@@ -24,7 +24,7 @@ describe('File DB', () => {
2424 sandbox . stub ( repoModule . db , 'findOne' ) . callsFake ( ( query , cb ) => cb ( null , repoData ) ) ;
2525
2626 const result = await repoModule . getRepo ( 'Sample' ) ;
27- expect ( result ) . to . equal ( repoData ) ;
27+ expect ( result ) . to . deep . equal ( repoData ) ;
2828 } ) ;
2929 } ) ;
3030
@@ -39,7 +39,7 @@ describe('File DB', () => {
3939 sandbox . stub ( repoModule . db , 'findOne' ) . callsFake ( ( query , cb ) => cb ( null , repoData ) ) ;
4040
4141 const result = await repoModule . getRepoByUrl ( 'https://github.com/finos/git-proxy.git' ) ;
42- expect ( result ) . to . equal ( repoData ) ;
42+ expect ( result ) . to . deep . equal ( repoData ) ;
4343 } ) ;
4444
4545 it ( 'should get the repo using the url, stripping off the .git' , async ( ) => {
@@ -53,36 +53,29 @@ describe('File DB', () => {
5353
5454 const result = await repoModule . getRepoByUrl ( 'https://github.com/finos/git-proxy.git' ) ;
5555
56- expect ( repoModule . db . findOne . calledWith ( sinon . match ( { url : 'https://github.com/finos/git-proxy.git' } ) ) ) . to . be . true ;
57- expect ( result ) . to . equal ( repoData ) ;
58- } ) ;
59-
60- it ( 'should get the repo using the url, ignoring the case' , async ( ) => {
61- const repoData = {
62- name : 'sample' ,
63- users : { canPush : [ ] } ,
64- url : 'https://github.com/finos/git-proxy.git' ,
65- } ;
66-
67- sandbox . stub ( repoModule . db , 'findOne' ) . callsFake ( ( query , cb ) => cb ( null , repoData ) ) ;
68-
69- const result = await repoModule . getRepoByUrl ( 'https://github.com/Finos/Git-Proxy.git' ) ;
70- expect ( result ) . to . equal ( repoData ) ;
71- expect ( repoModule . db . findOne . calledWith ( sinon . match ( { url : 'https://github.com/finos/git-proxy.git' } ) ) ) . to . be . true ;
56+ expect (
57+ repoModule . db . findOne . calledWith (
58+ sinon . match ( { url : 'https://github.com/finos/git-proxy.git' } ) ,
59+ ) ,
60+ ) . to . be . true ;
61+ expect ( result ) . to . deep . equal ( repoData ) ;
7262 } ) ;
7363
7464 it ( 'should return null if the repo is not found' , async ( ) => {
7565 sandbox . stub ( repoModule . db , 'findOne' ) . callsFake ( ( query , cb ) => cb ( null , null ) ) ;
7666
7767 const result = await repoModule . getRepoByUrl ( 'https://github.com/finos/missing-repo.git' ) ;
7868 expect ( result ) . to . be . null ;
79- expect ( repoModule . db . findOne . calledWith ( sinon . match ( { url : 'https://github.com/finos/missing-repo.git' } ) ) ,
69+ expect (
70+ repoModule . db . findOne . calledWith (
71+ sinon . match ( { url : 'https://github.com/finos/missing-repo.git' } ) ,
72+ ) ,
8073 ) . to . be . true ;
8174 } ) ;
8275
8376 it ( 'should reject if the database returns an error' , async ( ) => {
8477 sandbox . stub ( repoModule . db , 'findOne' ) . callsFake ( ( query , cb ) => cb ( new Error ( 'DB error' ) ) ) ;
85-
78+
8679 try {
8780 await repoModule . getRepoByUrl ( 'https://github.com/finos/git-proxy.git' ) ;
8881 expect . fail ( 'Expected promise to be rejected' ) ;
0 commit comments