Skip to content

Commit 5eb5d1d

Browse files
ZYSzysMylesBorins
authored andcommitted
test: test internal/util/types in vm
PR-URL: #25056 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent a5bccc2 commit 5eb5d1d

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

test/parallel/test-util-types.js

+34
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,40 @@ for (const [ value, _method ] of [
8282
{
8383
assert(!types.isUint8Array({ [Symbol.toStringTag]: 'Uint8Array' }));
8484
assert(types.isUint8Array(vm.runInNewContext('new Uint8Array')));
85+
86+
assert(!types.isUint8ClampedArray({
87+
[Symbol.toStringTag]: 'Uint8ClampedArray'
88+
}));
89+
assert(types.isUint8ClampedArray(
90+
vm.runInNewContext('new Uint8ClampedArray')
91+
));
92+
93+
assert(!types.isUint16Array({ [Symbol.toStringTag]: 'Uint16Array' }));
94+
assert(types.isUint16Array(vm.runInNewContext('new Uint16Array')));
95+
96+
assert(!types.isUint32Array({ [Symbol.toStringTag]: 'Uint32Array' }));
97+
assert(types.isUint32Array(vm.runInNewContext('new Uint32Array')));
98+
99+
assert(!types.isInt8Array({ [Symbol.toStringTag]: 'Int8Array' }));
100+
assert(types.isInt8Array(vm.runInNewContext('new Int8Array')));
101+
102+
assert(!types.isInt16Array({ [Symbol.toStringTag]: 'Int16Array' }));
103+
assert(types.isInt16Array(vm.runInNewContext('new Int16Array')));
104+
105+
assert(!types.isInt32Array({ [Symbol.toStringTag]: 'Int32Array' }));
106+
assert(types.isInt32Array(vm.runInNewContext('new Int32Array')));
107+
108+
assert(!types.isFloat32Array({ [Symbol.toStringTag]: 'Float32Array' }));
109+
assert(types.isFloat32Array(vm.runInNewContext('new Float32Array')));
110+
111+
assert(!types.isFloat64Array({ [Symbol.toStringTag]: 'Float64Array' }));
112+
assert(types.isFloat64Array(vm.runInNewContext('new Float64Array')));
113+
114+
assert(!types.isBigInt64Array({ [Symbol.toStringTag]: 'BigInt64Array' }));
115+
assert(types.isBigInt64Array(vm.runInNewContext('new BigInt64Array')));
116+
117+
assert(!types.isBigUint64Array({ [Symbol.toStringTag]: 'BigUint64Array' }));
118+
assert(types.isBigUint64Array(vm.runInNewContext('new BigUint64Array')));
85119
}
86120

87121
{

0 commit comments

Comments
 (0)