Skip to content

Commit

Permalink
Test coverage from 56% to 71% (#88)
Browse files Browse the repository at this point in the history
test coverage updates
---------

Co-authored-by: Rodolfo Miranda <[email protected]>
  • Loading branch information
rodolfomiranda and Rodolfo Miranda authored Aug 22, 2023
1 parent e55d80e commit 119d3df
Show file tree
Hide file tree
Showing 8 changed files with 475 additions and 90 deletions.
7 changes: 6 additions & 1 deletion examples/signify-react-ts/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

102 changes: 59 additions & 43 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"buffer": "^6.0.3",
"cbor": "^8.0.0",
"collections": "^5.1.12",
"jest-fetch-mock": "^3.0.3",
"libsodium-wrappers-sumo": "^0.7.9",
"lodash": "^4.17.21",
"mathjs": "^11.8.2",
Expand All @@ -73,6 +74,7 @@
"text-encoding": "^0.7.0",
"ts-node": "^10.9.1",
"urlsafe-base64": "^1.0.0",
"whatwg-fetch": "^3.6.17",
"xregexp": "^5.1.0"
}
}
1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export const ready:() => Promise<void> = (async() => {
export * from './keri/app/habery'
export * from './keri/app/signify'
export * from './keri/app/apping'
export * from './keri/app/client'
export * from './keri/app/controller'
export * from './keri/app/habery'
export * from './keri/app/signify'
Expand Down
26 changes: 0 additions & 26 deletions src/keri/app/client.ts

This file was deleted.

34 changes: 17 additions & 17 deletions src/keri/app/signify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ export class SignifyClient {
* @param {Array<string>} aids List of managed AIDs to be rotated
* @returns {Promise<Response>} A promise to the result of the rotation
*/
async rotate(nbran: string, aids: [string]): Promise<Response>{
async rotate(nbran: string, aids: string[]): Promise<Response>{
let data = this.controller.rotate(nbran, aids)
return await fetch(this.url + "/agent/" + this.controller.pre, {
method: "PUT",
Expand Down Expand Up @@ -464,7 +464,7 @@ export interface RotateIdentifierArgs {
}

/** Identifier */
class Identifier {
export class Identifier {
public client: SignifyClient
/**
* Identifier
Expand Down Expand Up @@ -785,7 +785,7 @@ class Identifier {
/**
* Oobis
*/
class Oobis {
export class Oobis {
public client: SignifyClient
/**
* Oobis
Expand Down Expand Up @@ -836,7 +836,7 @@ class Oobis {
* @remarks
* Operations represent the status and result of long running tasks performed by KERIA agent
*/
class Operations {
export class Operations {
public client: SignifyClient
/**
* Operations
Expand Down Expand Up @@ -865,7 +865,7 @@ class Operations {
/**
* KeyEvents
*/
class KeyEvents {
export class KeyEvents {
public client: SignifyClient
/**
* KeyEvents
Expand Down Expand Up @@ -894,7 +894,7 @@ class KeyEvents {
/**
* KeyStates
*/
class KeyStates {
export class KeyStates {
public client: SignifyClient
/**
* KeyStates
Expand Down Expand Up @@ -971,7 +971,7 @@ export interface CredentialFilter {
/**
* Credentials
*/
class Credentials {
export class Credentials {
public client: SignifyClient
/**
* Credentials
Expand Down Expand Up @@ -1352,7 +1352,7 @@ class Credentials {
/**
* Registries
*/
class Registries {
export class Registries {
public client: SignifyClient
/**
* Registries
Expand Down Expand Up @@ -1459,7 +1459,7 @@ class Registries {
/**
* Schemas
*/
class Schemas {
export class Schemas {
client: SignifyClient
/**
* Schemas
Expand Down Expand Up @@ -1498,7 +1498,7 @@ class Schemas {
/**
* Challenges
*/
class Challenges {
export class Challenges {
client: SignifyClient
/**
* Challenges
Expand All @@ -1512,9 +1512,9 @@ class Challenges {
* Generate a random challenge word list based on BIP39
* @async
* @param {number} strength Integer representing the strength of the challenge. Typically 128 or 256
* @returns {Promise<any>} A promise to the list of random words
* @returns {Promise<Response>} A promise to the list of random words
*/
async generate(strength: number = 128): Promise<any> {
async generate(strength: number = 128): Promise<Response> {
let path = `/challenges?strength=${strength.toString()}`
let method = 'GET'
let res = await this.client.fetch(path, method, null)
Expand All @@ -1527,9 +1527,9 @@ class Challenges {
* @param {string} name Name or alias of the identifier
* @param {string} recipient Prefix of the recipient of the response
* @param {Array<string>} words List of words to embed in the signed response
* @returns {Promise<any>} A promise to the result of the response
* @returns {Promise<Response>} A promise to the result of the response
*/
async respond(name: string, recipient: string, words: string[]) {
async respond(name: string, recipient: string, words: string[]): Promise<Response> {
let path = `/challenges/${name}`
let method = 'POST'

Expand Down Expand Up @@ -1596,7 +1596,7 @@ class Challenges {
/**
* Contacts
*/
class Contacts {
export class Contacts {
client: SignifyClient
/**
* Contacts
Expand Down Expand Up @@ -1690,7 +1690,7 @@ class Contacts {
/**
* Notifications
*/
class Notifications {
export class Notifications {
client: SignifyClient

/**
Expand Down Expand Up @@ -1750,7 +1750,7 @@ class Notifications {
/**
* Escrows
*/
class Escrows {
export class Escrows {
client: SignifyClient

/**
Expand Down
2 changes: 0 additions & 2 deletions src/keri/core/keeping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,6 @@ export class RandyKeeper {
public algo:Algos = Algos.randy
public signers:Signer[]



constructor(salter:Salter, code=MtrDex.Ed25519_Seed, count=1, icodes:string[]|undefined=undefined, transferable=false,
ncode=MtrDex.Ed25519_Seed, ncount=1, ncodes:string[], dcode=MtrDex.Blake3_256, prxs:string[]|undefined=undefined, nxts:string[]|undefined=undefined){

Expand Down
Loading

0 comments on commit 119d3df

Please sign in to comment.