Skip to content

Commit 70c407b

Browse files
committed
[Tests] drop node requirement to 0.10
1 parent 9b5eca8 commit 70c407b

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

.github/workflows/node-aught.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ jobs:
66
tests:
77
uses: ljharb/actions/.github/workflows/node.yml@main
88
with:
9-
range: '>= 3 < 10'
9+
range: '>= 0.8 < 10'
1010
type: minors
1111
command: npm run tests-only

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@
3030
"author": "Dominic Tarr <[email protected]> (dominictarr.com)",
3131
"license": "(MIT AND BSD-3-Clause)",
3232
"engines": {
33-
"node": ">= 3"
33+
"node": ">= 0.10"
3434
}
3535
}

test/test.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,13 @@ tape('hex encoding', function (t) {
9191
tape('call digest for more than MAX_UINT32 bits of data', function (t) {
9292
var sha1hash = crypto.createHash('sha1');
9393
var hash = new Sha1();
94-
var bigData = Buffer.alloc(0x1ffffffff / 8);
94+
var bigData;
95+
try {
96+
bigData = Buffer.alloc(0x1ffffffff / 8);
97+
} catch (err) {
98+
// node < 3 has a lower buffer size limit than node 3+. node 0.10 requires the `/8`, 0.12 - 2 are fine with `-8`
99+
bigData = Buffer.alloc(0x3fffffff / 8);
100+
}
95101

96102
hash.update(bigData);
97103
sha1hash.update(bigData);

0 commit comments

Comments
 (0)