]> git.r.bdr.sh - rbdr/dotfiles/blob
da12529bc0368c9c83fbc471ad43db0362712efe
[rbdr/dotfiles] /
1 'use strict';
2
3 var iteratorSymbol = require('es6-symbol').iterator;
4
5 module.exports = function (t, a) {
6 var x;
7 a.throws(function () { t(0); }, TypeError, "0");
8 a.throws(function () { t(false); }, TypeError, "false");
9 a.throws(function () { t(''); }, TypeError, "String");
10 a.throws(function () { t({}); }, TypeError, "Plain Object");
11 a.throws(function () { t(function () {}); }, TypeError, "Function");
12 a(t(x = new String('raz')), x, "String object"); //jslint: ignore
13
14 a(t(x = { length: 1 }), x, "Array like");
15 a.throws(function () { t(); }, TypeError, "Undefined");
16 a.throws(function () { t(null); }, TypeError, "null");
17 x = {};
18 x[iteratorSymbol] = function () {};
19 a(t(x), x, "Iterable");
20 };