Add sleep to selftest

This commit is contained in:
Simon Warta
2020-02-06 17:45:52 +01:00
parent 6c6177eec4
commit e9907026ed
3 changed files with 12 additions and 1 deletions
+1
View File
@@ -37,6 +37,7 @@
"@iov/crypto": "^2.0.0-alpha.7",
"@iov/encoding": "^2.0.0-alpha.7",
"@iov/keycontrol": "^2.0.0-alpha.7",
"@iov/utils": "^2.0.0-alpha.7",
"argparse": "^1.0.10",
"babylon": "^6.18.0",
"colors": "^1.3.3",
+6 -1
View File
@@ -76,6 +76,7 @@ export function main(originalArgs: readonly string[]): void {
"WalletSerializationString",
],
],
["@iov/utils", ["sleep"]],
]);
console.info(colors.green("Initializing session for you. Have fun!"));
@@ -109,11 +110,15 @@ export function main(originalArgs: readonly string[]): void {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
init += `import { ${imports.get(moduleName)!.join(", ")} } from "${moduleName}";\n`;
}
init += `const { toAscii, fromHex, toHex } = Encoding;\n`;
// helper functions
init += `
const { toAscii, fromHex, toHex } = Encoding;
`;
if (args.selftest) {
// execute some trival stuff and exit
init += `
await sleep(123);
const hash = new Sha512(new Uint8Array([])).digest();
const hexHash = toHex(hash);
export class NewDummyClass {};
+5
View File
@@ -157,6 +157,11 @@
dependencies:
xstream "^11.10.0"
"@iov/utils@^2.0.0-alpha.7":
version "2.0.0-alpha.7"
resolved "https://registry.yarnpkg.com/@iov/utils/-/utils-2.0.0-alpha.7.tgz#af9aebcb9e221e53cf62c5511f007c65d95f5c0c"
integrity sha512-myWATqmlCFZ/jSrsBQlyn+6D2ViAscZVAqBAw38kbIfv3TiKTjWb2RqhlNDnlVgt3uD0ZtQFyY9hkRMCwfIk+w==
"@koa/cors@^3.0.0":
version "3.0.0"
resolved "https://registry.yarnpkg.com/@koa/cors/-/cors-3.0.0.tgz#df021b4df2dadf1e2b04d7c8ddf93ba2d42519cb"