Sha256: 4c2c300737fd5f1d1837bf7b610145fb61db6a11459843869231e7321da27a93

Contents?: true

Size: 684 Bytes

Versions: 27

Compression:

Stored size: 684 Bytes

Contents

'use strict';

var test = require('tape');
var availableTypedArrays = require('available-typed-arrays')();
var forEach = require('for-each');
var v = require('es-value-fixtures');
var inspect = require('object-inspect');

var typedArrayBuffer = require('../');

test('typedArrayBuffer', function (t) {
	forEach(v.primitives.concat(v.objects), function (nonTA) {
		t['throws'](function () { typedArrayBuffer(nonTA); }, TypeError, inspect(nonTA) + ' is not a Typed Array');
	});

	forEach(availableTypedArrays, function (TA) {
		var ta = new global[TA](0);
		t.equal(typedArrayBuffer(ta), ta.buffer, inspect(ta) + ' has the same buffer as its own buffer property');
	});

	t.end();
});

Version data entries

27 entries across 27 versions & 2 rubygems

Version Path
immosquare-cleaner-0.1.32 node_modules/typed-array-buffer/test/index.js
immosquare-cleaner-0.1.31 node_modules/typed-array-buffer/test/index.js
immosquare-cleaner-0.1.30 node_modules/typed-array-buffer/test/index.js
immosquare-cleaner-0.1.29 node_modules/typed-array-buffer/test/index.js
immosquare-cleaner-0.1.28 node_modules/typed-array-buffer/test/index.js
immosquare-cleaner-0.1.27 node_modules/typed-array-buffer/test/index.js
immosquare-cleaner-0.1.26 node_modules/typed-array-buffer/test/index.js
immosquare-cleaner-0.1.25 node_modules/typed-array-buffer/test/index.js
immosquare-cleaner-0.1.24 node_modules/typed-array-buffer/test/index.js
immosquare-cleaner-0.1.23 node_modules/typed-array-buffer/test/index.js
immosquare-cleaner-0.1.22 node_modules/typed-array-buffer/test/index.js
immosquare-cleaner-0.1.21 node_modules/typed-array-buffer/test/index.js
immosquare-cleaner-0.1.20 node_modules/typed-array-buffer/test/index.js
immosquare-cleaner-0.1.19 node_modules/typed-array-buffer/test/index.js
immosquare-cleaner-0.1.18 node_modules/typed-array-buffer/test/index.js
immosquare-cleaner-0.1.17 node_modules/typed-array-buffer/test/index.js
immosquare-cleaner-0.1.16 node_modules/typed-array-buffer/test/index.js
immosquare-cleaner-0.1.14 node_modules/typed-array-buffer/test/index.js
immosquare-cleaner-0.1.13 node_modules/typed-array-buffer/test/index.js
immosquare-cleaner-0.1.12 node_modules/typed-array-buffer/test/index.js