aboutsummaryrefslogtreecommitdiff
path: root/src/types-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/types-test.ts
parent592fd62402b7f0fdb8dbe08605381d3a74d929f2 (diff)
downloadwallet-core-9a1b2c8ccc5f079dae4966dfd011f4076a53dc20.tar.xz
convert tests to ava tests
Diffstat (limited to 'src/types-test.ts')
-rw-r--r--src/types-test.ts22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/types-test.ts b/src/types-test.ts
index 32e07bd0f..bc053b40b 100644
--- a/src/types-test.ts
+++ b/src/types-test.ts
@@ -1,44 +1,44 @@
-import {test, TestLib} from "talertest";
+import {test} from "ava";
import {Amounts} from "./types";
import * as types from "./types";
let amt = (value: number, fraction: number, currency: string): types.AmountJson => ({value, fraction, currency});
-test("amount addition (simple)", (t: TestLib) => {
+test("amount addition (simple)", t => {
let a1 = amt(1,0,"EUR");
let a2 = amt(1,0,"EUR");
let a3 = amt(2,0,"EUR");
- t.assert(0 == types.Amounts.cmp(Amounts.add(a1, a2).amount, a3));
+ t.true(0 == types.Amounts.cmp(Amounts.add(a1, a2).amount, a3));
t.pass();
});
-test("amount addition (saturation)", (t: TestLib) => {
+test("amount addition (saturation)", t => {
let a1 = amt(1,0,"EUR");
let res = Amounts.add(Amounts.getMaxAmount("EUR"), a1);
- t.assert(res.saturated);
+ t.true(res.saturated);
t.pass();
});
-test("amount subtraction (simple)", (t: TestLib) => {
+test("amount subtraction (simple)", t => {
let a1 = amt(2,5,"EUR");
let a2 = amt(1,0,"EUR");
let a3 = amt(1,5,"EUR");
- t.assert(0 == types.Amounts.cmp(Amounts.sub(a1, a2).amount, a3));
+ t.true(0 == types.Amounts.cmp(Amounts.sub(a1, a2).amount, a3));
t.pass();
});
-test("amount subtraction (saturation)", (t: TestLib) => {
+test("amount subtraction (saturation)", t => {
let a1 = amt(0,0,"EUR");
let a2 = amt(1,0,"EUR");
let res = Amounts.sub(a1, a2);
- t.assert(res.saturated);
+ t.true(res.saturated);
res = Amounts.sub(a1, a1);
- t.assert(!res.saturated);
+ t.true(!res.saturated);
t.pass();
});
-test("contract validation", (t: TestLib) => {
+test("contract validation", t => {
let c = {
H_wire: "123",
summary: "hello",