Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- describe('mathEnforcer function test', () => {
- describe('addFive function test', () => {
- it('type of num is !== number', () => {
- assert(mathEnforcer.addFive('TEST') === undefined)
- });
- it('type of num is !== number (arr)', () => {
- assert(mathEnforcer.addFive([]) === undefined)
- });
- it('type of num is !== number (obj)', () => {
- assert(mathEnforcer.addFive({}) === undefined)
- });
- it('type of num is !== number (undefined)', () => {
- assert(mathEnforcer.addFive(undefined) === undefined)
- });
- it('type of num is !== number (null)', () => {
- assert(mathEnforcer.addFive(null) === undefined)
- });
- it('type of num is === number', () => {
- assert(mathEnforcer.addFive(5) === 10)
- });
- it('negative type of num is === number ', () => {
- assert(mathEnforcer.addFive(-5) === 0)
- });
- it('negative type of num is === number', () => {
- assert(mathEnforcer.addFive(5.5) === 10.5)
- });
- });
- describe('substractTen', () => {
- it('type of num is !== number', () => {
- assert(mathEnforcer.subtractTen('TEST') === undefined)
- });
- it('type of num is !== number (arr)', () => {
- assert(mathEnforcer.subtractTen([]) === undefined)
- });
- it('type of num is !== number (obj)', () => {
- assert(mathEnforcer.subtractTen({}) === undefined)
- });
- it('type of num is !== number (undefined)', () => {
- assert(mathEnforcer.subtractTen(undefined) === undefined)
- });
- it('type of num is !== number (null)', () => {
- assert(mathEnforcer.subtractTen(null) === undefined)
- });
- //wqeqweqweq
- it('positive integer num -10', () => {
- assert(mathEnforcer.subtractTen(5) === -5)
- });
- it('negative integer num -10', () => {
- assert(mathEnforcer.subtractTen(-5) === -15)
- });
- it('decimel num -10', () => {
- assert(mathEnforcer.subtractTen(15.5) === 5.5)
- });
- });
- describe('sum', () => {
- it('two positive numbers', () => {
- assert(mathEnforcer.sum(10, 10) === 20)
- });
- it('two negaive numbers', () => {
- assert(mathEnforcer.sum(-10, -2.5) === -12.5)
- });
- it('two decimal numbers', () => {
- assert(mathEnforcer.sum(3.2, 2.3) === 5.5)
- });
- it('return undefined first str', () => {
- assert(mathEnforcer.sum('rere', 10) === undefined);
- });
- it('return undefined second str', () => {
- assert(mathEnforcer.sum(10, 'rere') === undefined);
- });
- it('return undefined arr', () => {
- assert(mathEnforcer.sum(10, []) === undefined);
- });
- it('return undefined obj', () => {
- assert(mathEnforcer.sum(10, {}) === undefined);
- });
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement