mirror of
https://gitea.com/actions/setup-python.git
synced 2024-11-29 21:49:32 +01:00
34 lines
735 B
JavaScript
34 lines
735 B
JavaScript
'use strict';
|
|
|
|
var GetIntrinsic = require('../GetIntrinsic');
|
|
|
|
var test = require('tape');
|
|
var forEach = require('foreach');
|
|
var debug = require('object-inspect');
|
|
|
|
var v = require('./helpers/values');
|
|
|
|
test('export', function (t) {
|
|
t.equal(typeof GetIntrinsic, 'function', 'it is a function');
|
|
t.equal(GetIntrinsic.length, 2, 'function has length of 2');
|
|
|
|
t.end();
|
|
});
|
|
|
|
test('throws', function (t) {
|
|
t['throws'](
|
|
function () { GetIntrinsic('not an intrinsic'); },
|
|
SyntaxError,
|
|
'nonexistent intrinsic throws a syntax error'
|
|
);
|
|
|
|
forEach(v.nonBooleans, function (nonBoolean) {
|
|
t['throws'](
|
|
function () { GetIntrinsic('%', nonBoolean); },
|
|
TypeError,
|
|
debug(nonBoolean) + ' is not a Boolean'
|
|
);
|
|
});
|
|
|
|
t.end();
|
|
});
|