Skip to content

Commit

Permalink
add unit test stubs; remove rule silencing from index.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
david-focused authored and shavinac committed Apr 7, 2022
1 parent c21b858 commit 6eefc19
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 38 deletions.
40 changes: 6 additions & 34 deletions iam/src/__tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,39 +41,11 @@ describe("POST /challenge", function () {
// expect(response.status).toEqual(200);
expect(response.body).toEqual(expectedResponse);
});
});

//✅ MerkleProof verifiable contains the passed in username (test)

// ✅ Credential has verifiably been issued by did:key:z6Mkmhp2sE9s4AxFrKUXQjcNxbDV7WTM8xdh1FDNmNDtogdw

/*
{
"@context": [
"https://www.w3.org/2018/credentials/v1"
],
"type": [
"VerifiableCredential"
],
"credentialSubject": {
"id": "did:ethr:0xd23e91f4252d57aF484CE64BD02F3c693a9F83D9#Simple",
"root": "SZYY9hw6+iBFH8YI0GYalosmpOfGDgVnBcMpjLcsnqQ=",
"@context": [
{
"root": "https://schema.org/Text"
}
]
},
"issuer": "did:key:z6Mkmhp2sE9s4AxFrKUXQjcNxbDV7WTM8xdh1FDNmNDtogdw",
"issuanceDate": "2022-04-05T19:27:40.358Z",
"proof": {
"type": "Ed25519Signature2018",
"proofPurpose": "assertionMethod",
"verificationMethod": "did:key:z6Mkmhp2sE9s4AxFrKUXQjcNxbDV7WTM8xdh1FDNmNDtogdw#z6Mkmhp2sE9s4AxFrKUXQjcNxbDV7WTM8xdh1FDNmNDtogdw",
"created": "2022-04-05T19:27:40.358Z",
"jws": "eyJhbGciOiJFZERTQSIsImNyaXQiOlsiYjY0Il0sImI2NCI6ZmFsc2V9..NvVCewNj8GzgUPdmelVqi5U4VJo6P6tWgu11gvW99s2wmsfZjBarkm7zNi2rPVIKJBceOo09YXGnQuknWa_SCQ"
},
"expirationDate": "2022-05-05T19:27:40.358Z"
}
// TODO new unit test --> if credential.error then return 400
// TODO new unit test --> if !(await verifyCredential(DIDKit, credential)) then return 400
// TODO new unit test --> if utils.getAddress fails, then ???
// TODO new unit test --> if issueMerkleCredential fails, then ???
});

*/
// TODO test POST /verify endpoint
4 changes: 0 additions & 4 deletions iam/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
// /* eslint-disable @typescript-eslint/no-unsafe-member-access */
// /* eslint-disable @typescript-eslint/no-unsafe-argument */
// /* eslint-disable @typescript-eslint/ban-ts-comment */
// // @ts-nocheck
// // ---- Server
import express from "express";
// import cors from "cors";
Expand Down

0 comments on commit 6eefc19

Please sign in to comment.