Created
December 30, 2018 19:51
-
-
Save goldbergyoni/a82b32dfdaf97578411c5c236fa3183f to your computer and use it in GitHub Desktop.
Skim through complex code to understand the test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| it("When asking for an admin, ensure only ordered admins in results" , ()={ | |
| //assuming we've added here two admins "admin1", "admin2" and "user1" | |
| const allAdmins = getUsers({adminOnly:true}); | |
| const admin1Found, adming2Found = false; | |
| allAdmins.forEach(aSingleUser => { | |
| if(aSingleUser === "user1"){ | |
| assert.notEqual(aSingleUser, "user1", "A user was found and not admin"); | |
| } | |
| if(aSingleUser==="admin1"){ | |
| admin1Found = true; | |
| } | |
| if(aSingleUser==="admin2"){ | |
| admin2Found = true; | |
| } | |
| }); | |
| if(!admin1Found || !admin2Found ){ | |
| throw new Error("Not all admins were returned"); | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Line 5, there's a typo in the second variable :)