-
Notifications
You must be signed in to change notification settings - Fork 30.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. test addAbortSignal with invalid signal Refs: https://coverage.nodejs.org/coverage-a1509261770cb645/lib/internal/streams/add-abort-signal.js.html#L17 2. test addAbortSignal with invalid stream Refs: https://coverage.nodejs.org/coverage-a1509261770cb645/lib/internal/streams/add-abort-signal.js.html#L28 3. test addAbortSignalNoValidate with invalid signal Refs: https://coverage.nodejs.org/coverage-a1509261770cb645/lib/internal/streams/add-abort-signal.js.html#L34 4. test addAbortSignalNoValidate with aborted signal Refs: https://coverage.nodejs.org/coverage-a1509261770cb645/lib/internal/streams/add-abort-signal.js.html#L40 5. test Readable.from with invalid args Refs: https://coverage.nodejs.org/coverage-a1509261770cb645/lib/internal/streams/from.js.html#L31
- Loading branch information
Showing
3 changed files
with
49 additions
and
1 deletion.
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
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,27 @@ | ||
// Flags: --expose-internals | ||
'use strict'; | ||
|
||
require('../common'); | ||
const assert = require('assert'); | ||
const { addAbortSignal, Readable } = require('stream'); | ||
const { | ||
addAbortSignalNoValidate, | ||
} = require('internal/streams/add-abort-signal'); | ||
|
||
{ | ||
assert.throws(() => { | ||
addAbortSignal('INVALID_SIGNAL'); | ||
}, /ERR_INVALID_ARG_TYPE/); | ||
|
||
const ac = new AbortController(); | ||
assert.throws(() => { | ||
addAbortSignal(ac.signal, 'INVALID_STREAM'); | ||
}, /ERR_INVALID_ARG_TYPE/); | ||
} | ||
|
||
{ | ||
const r = new Readable({ | ||
read: () => {}, | ||
}); | ||
assert.deepStrictEqual(r, addAbortSignalNoValidate('INVALID_SIGNAL', r)); | ||
} |
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