Skip to content
This repository has been archived by the owner on Jul 13, 2022. It is now read-only.

 Add unit tests #62

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# dependencies
/node_modules

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.idea

Choose a reason for hiding this comment

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

Suggested change
.idea
.idea

We should add documentation on our standards for formatting, but I gently suggest we terminate all files with a new line per unix standards

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the suggestion but I am going to leave it as it is. The deadline is approaching and we need this merged ASAP.

I left a TODO comment so we can handle this issue on a future PR :)

Choose a reason for hiding this comment

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

LGTM

8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"scripts": {
"test": "NODE_ENV=test jest"
},
"dependencies": {
"jest": "^28.1.1"
}
}
18 changes: 18 additions & 0 deletions tests.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const getBitcoinPriceSixMonthsFromToday = () => {
return 58548
}

const getBitcoinPriceToday = () => {
return 21024
}

describe('when a user buys low', () => {
const initialPrice = getBitcoinPriceSixMonthsFromToday()

test('it should be able to sell high', () => {
const finalPrice = getBitcoinPriceToday()
expect(finalPrice).toBeGreaterThan(initialPrice);
Copy link

@cbeninati cbeninati Jun 24, 2022

Choose a reason for hiding this comment

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

Suggested change
expect(finalPrice).toBeGreaterThan(initialPrice);
expect(finalPrice).toBeGreaterThan(initialPrice)

Consistent terminating characters.

})
})


Loading