aboutsummaryrefslogtreecommitdiff
path: root/src/crypto/cryptoApi-test.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-05-27 19:20:27 +0200
committerFlorian Dold <florian.dold@gmail.com>2017-05-27 19:20:27 +0200
commit9a1b2c8ccc5f079dae4966dfd011f4076a53dc20 (patch)
tree961e2d42c69126791b9e890fa971f0f33ded1920 /src/crypto/cryptoApi-test.ts
parent592fd62402b7f0fdb8dbe08605381d3a74d929f2 (diff)
downloadwallet-core-9a1b2c8ccc5f079dae4966dfd011f4076a53dc20.tar.xz
convert tests to ava tests
Diffstat (limited to 'src/crypto/cryptoApi-test.ts')
-rw-r--r--src/crypto/cryptoApi-test.ts14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/crypto/cryptoApi-test.ts b/src/crypto/cryptoApi-test.ts
index 89b74d776..cc5d1156e 100644
--- a/src/crypto/cryptoApi-test.ts
+++ b/src/crypto/cryptoApi-test.ts
@@ -1,6 +1,6 @@
import {CryptoApi} from "./cryptoApi";
import {ReserveRecord, DenominationRecord, DenominationStatus} from "../types";
-import {test, TestLib} from "talertest";
+import {test} from "ava";
let masterPub1: string = "CQQZ9DY3MZ1ARMN5K1VKDETS04Y2QCKMMCFHZSWJWWVN82BTTH00";
@@ -45,15 +45,15 @@ let denomValid1: DenominationRecord = {
let denomInvalid1 = JSON.parse(JSON.stringify(denomValid1));
denomInvalid1.value.value += 1;
-test("string hashing", async (t: TestLib) => {
+test("string hashing", async t => {
let crypto = new CryptoApi();
let s = await crypto.hashString("hello taler");
let sh = "8RDMADB3YNF3QZBS3V467YZVJAMC2QAQX0TZGVZ6Q5PFRRAJFT70HHN0QF661QR9QWKYMMC7YEMPD679D2RADXCYK8Y669A2A5MKQFR";
- t.assert(s == sh);
+ t.true(s == sh);
t.pass();
});
-test("precoin creation", async (t: TestLib) => {
+test("precoin creation", async t => {
let crypto = new CryptoApi();
let {priv, pub} = await crypto.createEddsaKeypair();
let r: ReserveRecord = {
@@ -73,12 +73,12 @@ test("precoin creation", async (t: TestLib) => {
t.pass();
});
-test("denom validation", async (t: TestLib) => {
+test("denom validation", async t => {
let crypto = new CryptoApi();
let v: boolean;
v = await crypto.isValidDenom(denomValid1, masterPub1);
- t.assert(v);
+ t.true(v);
v = await crypto.isValidDenom(denomInvalid1, masterPub1);
- t.assert(!v);
+ t.true(!v);
t.pass();
});