mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
test: make test-eventemitter-asyncresource.js shorter
Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com> PR-URL: https://github.com/nodejs/node/pull/45146 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
@@ -143,17 +143,14 @@ throws(
|
||||
{ code: 'ERR_INVALID_THIS' }
|
||||
);
|
||||
|
||||
throws(
|
||||
() => Reflect.get(EventEmitterAsyncResource.prototype, 'asyncId', {}),
|
||||
{ code: 'ERR_INVALID_THIS' }
|
||||
);
|
||||
|
||||
throws(
|
||||
() => Reflect.get(EventEmitterAsyncResource.prototype, 'triggerAsyncId', {}),
|
||||
{ code: 'ERR_INVALID_THIS' }
|
||||
);
|
||||
|
||||
throws(
|
||||
() => Reflect.get(EventEmitterAsyncResource.prototype, 'asyncResource', {}),
|
||||
{ code: 'ERR_INVALID_THIS' }
|
||||
);
|
||||
['asyncId', 'triggerAsyncId', 'asyncResource'].forEach((getter) => {
|
||||
throws(
|
||||
() => Reflect.get(EventEmitterAsyncResource.prototype, getter, {}),
|
||||
{
|
||||
code: 'ERR_INVALID_THIS',
|
||||
name: /TypeError/,
|
||||
message: 'Value of "this" must be of type EventEmitterAsyncResource',
|
||||
stack: new RegExp(`at get ${getter}`)
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user