Skip to content

All done with Lab01#7

Open
dataluxe wants to merge 2 commits into
codefellows-seattle-javascript-401d19:masterfrom
dataluxe:master
Open

All done with Lab01#7
dataluxe wants to merge 2 commits into
codefellows-seattle-javascript-401d19:masterfrom
dataluxe:master

Conversation

@dataluxe
Copy link
Copy Markdown

No description provided.

return (typeof a === 'number' && typeof b === 'number') ? a - b : null;
};

module.exports = Arith;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is redundant

Comment thread lab-phelan/lib/greet.js
@@ -0,0 +1,9 @@
'use strict';

//const Greet = module.exports = {};
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

corpse code

expect(arith.add(1847, 'wrong')).toBe(null);
});

test('Testing arithmetic > sub function [positive case].', () => {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to be more descriptive you could have a describe block that says( 'testing arithmetic sub method') then test('it should return the product of a - b')

const greet = require(`../lib/greet`);

test('Testing greet > sayHi function.', () => {
expect(greet('world')).toBe('hello world');
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't always have to use toBe, you can also use toEqual, toBeTruthy, toBeFalsy, toMatch, toBeGreaterThan

Comment thread lab-phelan/README.md

In 'greet.js', per the instructions, I returned a single function, sayHi(), which appends 'hello ' to the front of a string provided by the user... and, if the user send in input other than of Type 'string', it returns 'null'.

In 'greet.js', per the instructions, I returned an Object, "Arith" with two functions within it; add() adds the two provided numbers together, and sub() subtracts them. In both functions, if either of the input values provided are not of Type 'number', I return 'null'.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arithmetic.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants