Skip to content

Commit

Permalink
[Tests] drop node requirement to 0.10
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Dec 1, 2024
1 parent 9b5eca8 commit 8befb1e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/node-aught.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ jobs:
tests:
uses: ljharb/actions/.github/workflows/node.yml@main
with:
range: '>= 3 < 10'
range: '>= 0.8 < 10'
type: minors
command: npm run tests-only
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
"author": "Dominic Tarr <[email protected]> (dominictarr.com)",
"license": "(MIT AND BSD-3-Clause)",
"engines": {
"node": ">= 3"
"node": ">= 0.10"
}
}
8 changes: 7 additions & 1 deletion test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,13 @@ tape('hex encoding', function (t) {
tape('call digest for more than MAX_UINT32 bits of data', function (t) {
var sha1hash = crypto.createHash('sha1');
var hash = new Sha1();
var bigData = Buffer.alloc(0x1ffffffff / 8);
var bigData;
try {
bigData = Buffer.alloc(0x1ffffffff / 8);
} catch (e) {
// node < 3 has a lower buffer size limit than node 3+. node 0.10 requires the `/8`, 0.12 - 2 are fine with `-8`
bigData = Buffer.alloc(0x3fffffff / 8);
}

hash.update(bigData);
sha1hash.update(bigData);
Expand Down

0 comments on commit 8befb1e

Please sign in to comment.