-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: improve test coverage of internal/blob
PR-URL: nodejs/node#41513 Refs: https://coverage.nodejs.org/coverage-74b9baa4265a8f0d/lib/internal/blob.js.html Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Daijiro Wachi <[email protected]>
- Loading branch information
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Flags: --no-warnings | ||
'use strict'; | ||
|
||
const common = require('../common'); | ||
const assert = require('assert'); | ||
const { Blob } = require('buffer'); | ||
|
||
if (common.isFreeBSD) | ||
common.skip('Oversized buffer make the FreeBSD CI runner crash'); | ||
|
||
try { | ||
new Blob([new Uint8Array(0xffffffff), [1]]); | ||
} catch (e) { | ||
if ( | ||
e.message === 'Array buffer allocation failed' || | ||
e.message === 'Invalid typed array length: 4294967295' | ||
) { | ||
common.skip( | ||
'Insufficient memory on this platform for oversized buffer test.' | ||
); | ||
} else { | ||
assert.strictEqual(e.code, 'ERR_BUFFER_TOO_LARGE'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters