-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test and function files are wired together. Test is failing.
- Loading branch information
Showing
3 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
## Setting Up | ||
I used NPM. | ||
Refer to https://semaphoreci.com/community/tutorials/getting-started-with-node-js-and-mocha | ||
It was mainly just `npm install --save mocha chai express request ` | ||
|
||
## Running tests | ||
Once you have some tests in the test directory you just say | ||
`npx mocha --reporter spec` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
exports.rightDigit = function(numbers){ | ||
console.log('Been to Spain!'); | ||
var tuna = 42; | ||
return [111, 222]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Given a list of non-negative integers, return an integer list of the rightmost digits. (Note: use %) | ||
// https://codingbat.com/prob/p152194 | ||
// https://semaphoreci.com/community/tutorials/getting-started-with-node-js-and-mocha | ||
console.log('Been to Germany!'); | ||
|
||
var expect = require("chai").expect; | ||
var thingtotest = require("../rightDigit.js"); | ||
console.log('111' + typeof thingtotest.rightDigit); | ||
console.log('222' + Object.keys(thingtotest.rightDigit).toString()); | ||
console.log('333' + Object.keys(thingtotest.rightDigit).length); | ||
describe('Digit getter', () => { | ||
it('gets just the last digit of each', () =>{ | ||
|
||
var blueHex = thingtotest.rightDigit([1, 22, 93]); | ||
expect(blueHex).to.equal([]); | ||
}) | ||
}); | ||
|
||
|
||
// rightDigit([1, 22, 93]); // [1, 2, 3] | ||
// rightDigit([16, 8, 886, 8, 1]); // [6, 8, 6, 8, 1] | ||
// rightDigit([10, 0]); // [0, 0] |