Skip to content

Commit

Permalink
Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Jan 24, 2020
1 parent dedfbc1 commit b539830
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
9 changes: 7 additions & 2 deletions package.json
Expand Up @@ -6,7 +6,9 @@
"scripts": {
"lint": "eslint .",
"pretest": "npm run lint",
"test": "echo \"Error: no test specified\" && exit 1",
"tests-only": "node test",
"test": "npm run tests-only",
"posttest": "npx aud",
"version": "auto-changelog && git add CHANGELOG.md",
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
},
Expand Down Expand Up @@ -43,8 +45,11 @@
},
"devDependencies": {
"@ljharb/eslint-config": "^15.1.0",
"array.prototype.every": "^1.1.0",
"auto-changelog": "^1.16.2",
"eslint": "^6.8.0"
"eslint": "^6.8.0",
"isarray": "^2.0.5",
"tape": "^5.0.0-next.4"
},
"auto-changelog": {
"output": "CHANGELOG.md",
Expand Down
18 changes: 18 additions & 0 deletions test/index.js
@@ -0,0 +1,18 @@
'use strict';

var test = require('tape');
var isArray = require('isarray');
var every = require('array.prototype.every');

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

test('available typed arrays', function (t) {
t.equal(typeof availableTypedArrays, 'function', 'is a function');

var arrays = availableTypedArrays();
t.equal(isArray(arrays), true, 'returns an array');

t.equal(every(arrays, function (array) { return typeof array === 'string'; }), true, 'contains only strings');

t.end();
});

0 comments on commit b539830

Please sign in to comment.