Skip to content

Commit

Permalink
Merge pull request #954 from iov-one/rm-jasmine2-custom-message
Browse files Browse the repository at this point in the history
Migrate from jasmine2-custom-message to native withContext()
  • Loading branch information
willclarktech authored May 1, 2019
2 parents 0d8e596 + 29722f2 commit 92b6eaa
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 18 deletions.
2 changes: 0 additions & 2 deletions custom_types/jasmine2-custom-message/index.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"cross-env": "^5.2.0",
"jasmine": "^3.3.1",
"jasmine-console-reporter": "^3.0.2",
"jasmine2-custom-message": "^0.9.1",
"karma": "^3.1.4",
"karma-chrome-launcher": "^2.2.0",
"karma-edge-launcher": "^0.4.2",
Expand Down
18 changes: 8 additions & 10 deletions packages/iov-crypto/src/secp256k1.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/* tslint:disable:no-bitwise */
import since = require("jasmine2-custom-message");

import { Encoding } from "@iov/encoding";

import { Secp256k1 } from "./secp256k1";
Expand Down Expand Up @@ -265,8 +263,8 @@ describe("Secp256k1", () => {
const pubkey = (await Secp256k1.makeKeypair(row.privkey)).pubkey;
const messageHash = new Sha256(row.message).digest();
const isValid = await Secp256k1.verifySignature(Secp256k1Signature.fromDer(row.signature), messageHash, pubkey);
since(`(index ${index}) #{message}`)
.expect(isValid)
expect(isValid)
.withContext(`(index ${index})`)
.toEqual(true);
}
});
Expand Down Expand Up @@ -335,19 +333,19 @@ describe("Secp256k1", () => {

// verify calculated signature
const ok1 = await Secp256k1.verifySignature(calculatedSignature, messageHash, keypair.pubkey);
since(`(index ${index}) #{message}`)
.expect(ok1)
expect(ok1)
.withContext(`(index ${index})`)
.toEqual(true);

// verify original signature
const ok2 = await Secp256k1.verifySignature(Secp256k1Signature.fromDer(row.signature), messageHash, keypair.pubkey);
since(`(index ${index}) #{message}`)
.expect(ok2)
expect(ok2)
.withContext(`(index ${index})`)
.toEqual(true);

// compare signatures
since(`(index ${index}) #{message}`)
.expect(calculatedSignature.toDer())
expect(calculatedSignature.toDer())
.withContext(`(index ${index})`)
.toEqual(row.signature);
}
});
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3773,11 +3773,6 @@ jasmine-core@^3.3, jasmine-core@~3.3.0:
resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-3.3.0.tgz#dea1cdc634bc93c7e0d4ad27185df30fa971b10e"
integrity sha512-3/xSmG/d35hf80BEN66Y6g9Ca5l/Isdeg/j6zvbTYlTzeKinzmaTM4p9am5kYqOmE05D7s1t8FGjzdSnbUbceA==

jasmine2-custom-message@^0.9.1:
version "0.9.3"
resolved "https://registry.yarnpkg.com/jasmine2-custom-message/-/jasmine2-custom-message-0.9.3.tgz#d4afa636549c0ad345d384a81d167aec9a7dfc3d"
integrity sha512-ImGW7VN9GDDPpZCwuNEpipf4cFxg7k802GN82AnesziKNPmcYwxbh4lSVcu7LqHQoVnwORDBqX3vjYKKmOzdOw==

jasmine@^3.3.1:
version "3.3.1"
resolved "https://registry.yarnpkg.com/jasmine/-/jasmine-3.3.1.tgz#d61bb1dd8888859bd11ea83074a78ee13d949905"
Expand Down

0 comments on commit 92b6eaa

Please sign in to comment.