UNPKG

node-bcc

Version:

A simple Block Check Character library.

40 lines 1.67 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const chai_1 = require("chai"); const helper_1 = require("./helper"); /* eslint-disable @typescript-eslint/no-explicit-any */ describe('Helper', () => { describe('checkArray', () => { it('should return false if array is null', () => { const arr = null; chai_1.expect(helper_1.Helper.checkArray(arr)).to.be.false; }); it('should return false if array is undefined', () => { const arr = undefined; chai_1.expect(helper_1.Helper.checkArray(arr)).to.be.false; }); it('should return false if array is of zero length', () => { chai_1.expect(helper_1.Helper.checkArray([])).to.be.false; }); it('should return true if array is valid', () => { chai_1.expect(helper_1.Helper.checkArray([1, 2, 3])).to.be.true; }); }); describe('checkString', () => { it('should return false if input is null', () => { const str = null; chai_1.expect(helper_1.Helper.checkString(str)).to.be.false; }); it('should return false if input is undefined', () => { const str = undefined; chai_1.expect(helper_1.Helper.checkString(str)).to.be.false; }); it('should return false if input is empty', () => { chai_1.expect(helper_1.Helper.checkString('')).to.be.false; }); it('should return true if string is not empty', () => { chai_1.expect(helper_1.Helper.checkString('ABC')).to.be.true; }); }); }); //# sourceMappingURL=helper.spec.js.map