• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2
3var GetIntrinsic = require('../GetIntrinsic');
4
5var test = require('tape');
6var forEach = require('foreach');
7var debug = require('object-inspect');
8
9var v = require('./helpers/values');
10
11test('export', function (t) {
12	t.equal(typeof GetIntrinsic, 'function', 'it is a function');
13	t.equal(GetIntrinsic.length, 2, 'function has length of 2');
14
15	t.end();
16});
17
18test('throws', function (t) {
19	t['throws'](
20		function () { GetIntrinsic('not an intrinsic'); },
21		SyntaxError,
22		'nonexistent intrinsic throws a syntax error'
23	);
24
25	forEach(v.nonBooleans, function (nonBoolean) {
26		t['throws'](
27			function () { GetIntrinsic('%', nonBoolean); },
28			TypeError,
29			debug(nonBoolean) + ' is not a Boolean'
30		);
31	});
32
33	t.end();
34});
35