diff --git a/test/basic.test.js b/test/basic.test.js index 175be1d..1c948a4 100644 --- a/test/basic.test.js +++ b/test/basic.test.js @@ -4,7 +4,7 @@ import * as fc from 'fast-check'; import * as secp256k1 from '../index.js'; import * as h from './secp256k1.helpers.js'; -const CURVES = { secp256k1 } +const CURVES = { secp256k1 }; const name = 'secp256k1'; const C = CURVES[name]; const CURVE_ORDER = C.CURVE.n; @@ -136,10 +136,7 @@ for (const pointName in POINTS) { throws(() => G[1][op]('1'), "'1'"); throws(() => G[1][op]({ x: 1n, y: 1n }), '{ x: 1n, y: 1n }'); throws(() => G[1][op]({ x: 1n, y: 1n, z: 1n }), '{ x: 1n, y: 1n, z: 1n }'); - throws( - () => G[1][op]({ x: 1n, y: 1n, z: 1n, t: 1n }), - '{ x: 1n, y: 1n, z: 1n, t: 1n }' - ); + throws(() => G[1][op]({ x: 1n, y: 1n, z: 1n, t: 1n }), '{ x: 1n, y: 1n, z: 1n, t: 1n }'); throws(() => G[1][op](new Uint8Array([])), 'ui8a([])'); throws(() => G[1][op](new Uint8Array([0])), 'ui8a([0])'); throws(() => G[1][op](new Uint8Array([1])), 'ui8a([1])'); @@ -264,11 +261,7 @@ describe(name, () => { const pub = C.getPublicKey(priv); const sig = C.sign(msg, priv); const err = `priv=${toHex(priv)},pub=${toHex(pub)},msg=${msg}`; - deepStrictEqual( - C.verify(sig, msg, pub), - true, - err - ); + deepStrictEqual(C.verify(sig, msg, pub), true, err); }), { numRuns: NUM_RUNS } ) @@ -399,7 +392,7 @@ describe(name, () => { }); // ESM is broken. -import url from 'url'; +import url from 'node:url'; if (import.meta.url === url.pathToFileURL(process.argv[1]).href) { should.run(); } diff --git a/test/secp256k1.test.js b/test/secp256k1.test.js index 7a51292..e2a2df2 100644 --- a/test/secp256k1.test.js +++ b/test/secp256k1.test.js @@ -1,7 +1,7 @@ import { hexToBytes, bytesToHex as hex } from '@noble/hashes/utils'; -import { deepStrictEqual, throws } from 'assert'; +import { deepStrictEqual, throws } from 'node:assert'; import * as fc from 'fast-check'; -import { readFileSync } from 'fs'; +import { readFileSync } from 'node:fs'; import { should, describe } from 'micro-should'; // prettier-ignore import { @@ -543,7 +543,7 @@ describe('secp256k1', () => { }); // ESM is broken. -import url from 'url'; +import url from 'node:url'; if (import.meta.url === url.pathToFileURL(process.argv[1]).href) { should.run(); }