Skip to content
This repository has been archived by the owner on Jan 11, 2022. It is now read-only.

Commit

Permalink
Skip bigint test on node < v10
Browse files Browse the repository at this point in the history
  • Loading branch information
wemeetagain committed Apr 7, 2020
1 parent 3888e5d commit d1138f9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/dataTypes.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { version } from 'process'
import * as assert from 'assert'
import * as RLP from '../src'
const BN = require('bn.js')
Expand Down Expand Up @@ -62,6 +63,13 @@ describe('RLP encoding (list):', function() {
})

describe('RLP encoding (BigInt):', function() {
before(function() {
const nodeVersionNumber = Number(version.match(/^v([0-9]+)/)![1])
if (nodeVersionNumber < 10) {
// tslint:disable-next-line no-invalid-this
this.skip()
}
})
it('should encode a BigInt value', function() {
const encodedBN = RLP.encode(BigInt(3))
assert.equal(encodedBN[0], 3)
Expand Down

0 comments on commit d1138f9

Please sign in to comment.