Skip to content

Commit

Permalink
[Tests] fix .test param order
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Feb 11, 2024
1 parent ccc5bfc commit fae569b
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 13 deletions.
4 changes: 2 additions & 2 deletions test/Uint8Array.fromBase64.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var shimName = 'Uint8Array.fromBase64';

module.exports = {
tests: function (t, method) {
t.test({ skip: typeof Uint8Array === 'function' }, 'Uint8Arrays not supported', function (st) {
t.test('Uint8Arrays not supported', { skip: typeof Uint8Array === 'function' }, function (st) {
st['throws'](
function () { return method(''); },
SyntaxError,
Expand All @@ -24,7 +24,7 @@ module.exports = {
st.end();
});

t.test({ skip: typeof Uint8Array !== 'function' }, 'Uint8Arrays supported', function (st) {
t.test('Uint8Arrays supported', { skip: typeof Uint8Array !== 'function' }, function (st) {
st['throws'](
function () { return method('F'); },
SyntaxError,
Expand Down
4 changes: 2 additions & 2 deletions test/Uint8Array.fromHex.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var shimName = 'Uint8Array.fromHex';

module.exports = {
tests: function (t, method) {
t.test({ skip: typeof Uint8Array === 'function' }, 'Uint8Arrays not supported', function (st) {
t.test('Uint8Arrays not supported', { skip: typeof Uint8Array === 'function' }, function (st) {
st['throws'](
function () { return method(''); },
SyntaxError,
Expand All @@ -24,7 +24,7 @@ module.exports = {
st.end();
});

t.test({ skip: typeof Uint8Array !== 'function' }, 'Uint8Arrays supported', function (st) {
t.test('Uint8Arrays supported', { skip: typeof Uint8Array !== 'function' }, function (st) {
st['throws'](
function () { return method('F'); },
SyntaxError,
Expand Down
4 changes: 2 additions & 2 deletions test/Uint8Array.prototype.setFromBase64.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var shimName = 'Uint8Array.prototype.setFromBase64';

module.exports = {
tests: function (t, method) {
t.test({ skip: typeof Uint8Array === 'function' }, 'Uint8Arrays not supported', function (st) {
t.test('Uint8Arrays not supported', { skip: typeof Uint8Array === 'function' }, function (st) {
st['throws'](
function () { return method(''); },
SyntaxError,
Expand All @@ -25,7 +25,7 @@ module.exports = {
st.end();
});

t.test({ skip: typeof Uint8Array !== 'function' }, 'Uint8Arrays supported', function (st) {
t.test('Uint8Arrays supported', { skip: typeof Uint8Array !== 'function' }, function (st) {
var arr = new Uint8Array(12);
arr[0] = 1;

Expand Down
5 changes: 2 additions & 3 deletions test/Uint8Array.prototype.setFromHex.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var shimName = 'Uint8Array.prototype.setFromHex';

module.exports = {
tests: function (t, method) {
t.test({ skip: typeof Uint8Array === 'function' }, 'Uint8Arrays not supported', function (st) {
t.test('Uint8Arrays not supported', { skip: typeof Uint8Array === 'function' }, function (st) {
st['throws'](
function () { return method(''); },
SyntaxError,
Expand All @@ -25,7 +25,7 @@ module.exports = {
st.end();
});

t.test({ skip: typeof Uint8Array !== 'function' }, 'Uint8Arrays supported', function (st) {
t.test('Uint8Arrays supported', { skip: typeof Uint8Array !== 'function' }, function (st) {
var arr = new Uint8Array(256);
arr[0] = 1;

Expand Down Expand Up @@ -89,7 +89,6 @@ module.exports = {
t.equal(impl, polyfill, 'implementation is polyfill itself');

module.exports.tests(t, callBind(impl));

t.end();
});
},
Expand Down
4 changes: 2 additions & 2 deletions test/Uint8Array.prototype.toBase64.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var shimName = 'Uint8Array.prototype.' + methodName;

module.exports = {
tests: function (t, method) {
t.test({ skip: typeof Uint8Array === 'function' }, 'Uint8Arrays not supported', function (st) {
t.test('Uint8Arrays not supported', { skip: typeof Uint8Array === 'function' }, function (st) {
st['throws'](
function () { return method(); },
SyntaxError,
Expand All @@ -26,7 +26,7 @@ module.exports = {
st.end();
});

t.test({ skip: typeof Uint8Array !== 'function' }, 'Uint8Arrays supported', function (st) {
t.test('Uint8Arrays supported', { skip: typeof Uint8Array !== 'function' }, function (st) {
st.deepEqual(method(new Uint8Array([])), '', 'empty array produces empty string');

var array = new Uint8Array([251, 255, 191]);
Expand Down
4 changes: 2 additions & 2 deletions test/Uint8Array.prototype.toHex.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var shimName = 'Uint8Array.prototype.' + methodName;

module.exports = {
tests: function (t, method) {
t.test({ skip: typeof Uint8Array === 'function' }, 'Uint8Arrays not supported', function (st) {
t.test('Uint8Arrays not supported', { skip: typeof Uint8Array === 'function' }, function (st) {
st['throws'](
function () { return method(); },
SyntaxError,
Expand All @@ -27,7 +27,7 @@ module.exports = {
st.end();
});

t.test({ skip: typeof Uint8Array !== 'function' }, 'Uint8Arrays supported', function (st) {
t.test('Uint8Arrays supported', { skip: typeof Uint8Array !== 'function' }, function (st) {
st.deepEqual(method(new Uint8Array([])), '', 'empty array produces empty string');

var array = new Uint8Array([251, 255, 191]);
Expand Down

0 comments on commit fae569b

Please sign in to comment.