Skip to content
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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ That's actually a good question. I guess that discovery does not happen with a s

# How to run?

from console, install jest
from console, install with npm:
```
npm install --save-dev jest
npm install
```

then you can just run the tests
Expand All @@ -45,4 +45,4 @@ npm test
if you want to benchmark use
```
npm run bench
```
```
8 changes: 7 additions & 1 deletion javascript/The73Calculator.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ module.exports = class The73Calculator {
return n;
}

static noop(n) {}
static octal(n) {
let numberAsOctal = (n + 4).toString(8)
numberAsOctal = parseInt(numberAsOctal) % 10

return numberAsOctal;
}

static noop(n) {}
};
8 changes: 3 additions & 5 deletions javascript/The73Calculator.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,12 @@ describe("The73Calculator", () => {
test(The73Calculator.usingPolynom.name, () => {
expectBehavior(The73Calculator.usingPolynom);
});



test(The73Calculator.octal.name, () => {
expectBehavior(The73Calculator.octal);
});

function expectBehavior(f) {
expect(f(3)).toBe(7);
expect(f(7)).toBe(3);
}


});