@qntm-code/utils
Version:
A collection of useful utility functions with associated TypeScript types. All functions have been unit tested.
26 lines (25 loc) • 899 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
/* eslint-disable prefer-rest-params */
const isArguments_1 = require("./isArguments");
const strictArgs = (function (_a, _b, _c) {
'use strict';
return arguments;
})(1, 2, 3);
describe(`isArguments`, () => {
it(`should return true if value is an Arguments object`, () => {
const value = (function () {
return arguments;
})();
expect((0, isArguments_1.isArguments)(value)).toBe(true);
});
it(`should return true if value is an Arguments object (string)`, () => {
expect((0, isArguments_1.isArguments)(strictArgs)).toBe(true);
});
it(`should return false if value is not an Arguments object`, () => {
const value = (function () {
return;
})();
expect((0, isArguments_1.isArguments)(value)).toBe(false);
});
});