Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implements all 10 functions for this week and test scrips that all pass #2

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

hollisjamison
Copy link

No description provided.

@hollisjamison
Copy link
Author

hollisjamison commented Jul 11, 2020

Writing the tests my self instead of being given them taught me a lot.

Was very happy to see this screen:
image

I looked for 15 minutes or so of a way to read the last 5 messages in the console, but couldn't figure it out. Instead I would add each message console.log into an array then make assert that the array matched my result.

Is there a way to actually expect the last 5 console.log messages to = something?

@@ -99,10 +168,51 @@
in the terminal
@Test - Make a function call of `trackGallonsUsed(5)`
*/
function trackGallonsUsed(gallons) {
let consoleLog = []

Copy link
Member

Choose a reason for hiding this comment

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

Nicely done.



/*
@Challenge 10 - Write a function named `getHighScore` that finds the highest value in an array of scores
@Example - Sending the function a value of [1999,2020,3080,1111] will result in 3080
@Test - Write a console.log that shows the value of `getHighScore([1999,2020,3080,1111])`
*/
function getHighScore(listOfScores){
let highScore = 0

Copy link
Member

Choose a reason for hiding this comment

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

Great work here.

console.log(highScore)
return highScore
}

Copy link
Member

Choose a reason for hiding this comment

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

Looks like an extra getHighScore reference sitting on line 206. No harm in it but making note since it is there.

}

getHighScore
module.exports = {
Copy link
Member

Choose a reason for hiding this comment

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

Nice work on these exports using the object syntax and the shorthand key/value syntax.

@@ -4,7 +4,7 @@
"description": "## The Mission",
"main": "index.js",
"scripts": {
"test": "nodemon index.js"
"test": "mocha"
Copy link
Member

Choose a reason for hiding this comment

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

Nice.

Copy link
Member

@johnny-rice johnny-rice left a comment

Choose a reason for hiding this comment

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

This is outstanding work.

@@ -0,0 +1,23 @@
const assert = require('assert')
Copy link
Member

Choose a reason for hiding this comment

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

This is next level effort. Happy to see it. Outstanding work.

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