Statements | Branches | Functions | Lines |
---|---|---|---|
Package | Version | Size | Link |
---|---|---|---|
@portkey/did |
|||
@portkey/accounts |
|||
@portkey/contracts |
|||
@portkey/graphql |
|||
@portkey/request |
|||
@portkey/services |
|||
@portkey/types |
|||
@portkey/utils |
|||
@portkey/validator |
|||
@portkey/socket |
|||
UI Packages | |||
@portkey/did-ui-react |
for users
yarn
# build packages
yarn build
# try to run test
yarn test
Write you interface and test case at first.
For example, if we want to run did.init();
// first step
// in interface files
export interface IDid {
init(): boolean;
}
// second step
// intest files list did.test.ts
describe('did', () => {
test('did init', () => {
expect(did.init()).resolves.toBeTrue(); // true
});
});
// third step
// implement the interface
class Did implements IDid {
init() {
return true;
}
}
# run your test
npx jest ./packages/did/test/did.test.ts
# if passed, success
Loop the steps to get an awesome program.
@injectable()
class Did implements IDid {
init() {
return true;
}
}
Node: jest will help us to write a better program with ioc.