Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- describe('numberOperations tests', () => {
- describe('powNumber', () => {
- it('Test 1', () => {
- let num = 3;
- expect(numberOperations.powNumber(num)).to.equal(9);
- });
- it('Test 1', () => {
- let num = 0;
- expect(numberOperations.powNumber(num)).to.equal(0);
- });
- it('Test 1', () => {
- let num = 1;
- expect(numberOperations.powNumber(num)).to.equal(1);
- });
- it('Test 1', () => {
- let num = -1;
- expect(numberOperations.powNumber(num)).to.equal(1);
- });
- it('Test 1', () => {
- let num = -3;
- expect(numberOperations.powNumber(num)).to.equal(9);
- });
- });
- describe('numberChecker', () => {
- it('Test 1', () => {
- let input = Number('k');
- expect(() => numberOperations.numberChecker(input)).to.throw();
- });
- it('Test 1', () => {
- let input = undefined;
- expect(() => numberOperations.numberChecker(input)).to.throw();
- });
- it('Test 1', () => {
- let input = 99;
- expect(numberOperations.numberChecker(input)).to.equal('The number is lower than 100!');
- });
- it('Test 1', () => {
- let input = 100;
- expect(numberOperations.numberChecker(input)).to.equal('The number is greater or equal to 100!');
- });
- it('Test 1', () => {
- let input = 101;
- expect(numberOperations.numberChecker(input)).to.equal('The number is greater or equal to 100!');
- });
- });
- describe('sumArrays', () => {
- it('Test 1', () => {
- let array1 = [1, 4, 8];
- let array2 = [2, 7];
- expect(numberOperations.sumArrays(array1, array2)).to.equal([3, 11, 8]);
- });
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement