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 all 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
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# dependencies
/node_modules

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

TODO: terminate files with new line per unix standard

Choose a reason for hiding this comment

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

The sensible choice of terms here would be end of line (EOL) given it is intended here to represent the end of a line, not the beginning of an always empty line.

Suggested change
TODO: terminate files with new line per unix standard
TODO: terminate files with end of line per unix standard

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