bitcoinjs-lib/test/types.js

19 lines
529 B
JavaScript
Raw Normal View History

2015-08-25 05:52:24 +02:00
/* global describe, it */
var assert = require('assert')
var types = require('../src/types')
describe('types', function () {
2015-09-05 07:42:25 +02:00
describe('BigInt/ECPoint', function () {
2015-08-25 05:52:24 +02:00
it('return true for duck types', function () {
2015-09-05 07:42:25 +02:00
assert(types.BigInt(new function BigInteger () {}))
assert(types.ECPoint(new function Point () {}))
})
it('return false for bad types', function () {
assert(!types.BigInt(new function NotABigInteger () {}))
assert(!types.ECPoint(new function NotAPoint () {}))
2015-08-25 05:52:24 +02:00
})
})
})