mirror of
https://github.com/joelwmale/webhook-action.git
synced 2024-12-02 04:15:23 +01:00
28 lines
647 B
JavaScript
28 lines
647 B
JavaScript
'use strict';
|
|
|
|
var test = require('tape');
|
|
var forEach = require('foreach');
|
|
var debug = require('object-inspect');
|
|
|
|
var isByteValue = require('../../helpers/isByteValue');
|
|
var v = require('./values');
|
|
|
|
test('isByteValue', function (t) {
|
|
forEach([].concat(
|
|
v.notNonNegativeIntegers,
|
|
-1,
|
|
-42,
|
|
-Infinity,
|
|
Infinity,
|
|
v.nonIntegerNumbers
|
|
), function (nonByteValue) {
|
|
t.equal(isByteValue(nonByteValue), false, debug(nonByteValue) + ' is not a byte value');
|
|
});
|
|
|
|
for (var i = 0; i <= 255; i += 1) {
|
|
t.equal(isByteValue(i), true, i + ' is a byte value');
|
|
}
|
|
t.equal(isByteValue(256), false, '256 is not a byte value');
|
|
|
|
t.end();
|
|
});
|