forked from LaunchCodeEducation/javascript-projects
-
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.
- Loading branch information
Showing
10 changed files
with
14,575 additions
and
1 deletion.
There are no files selected for viewing
3,631 changes: 3,631 additions & 0 deletions
3,631
unit-testing/chapter-examples/hello-jest/package-lock.json
Large diffs are not rendered by default.
Oops, something went wrong.
3,631 changes: 3,631 additions & 0 deletions
3,631
unit-testing/chapter-examples/palindrome-example/package-lock.json
Large diffs are not rendered by default.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
unit-testing/chapter-examples/palindrome-example/tests/palindrome.test.js
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,16 @@ | ||
const isPalindrome = require('../palindrome.js'); | ||
|
||
describe("testing isPalindrome", function(){ | ||
test("should return true for a single letter", function(){ | ||
expect(isPalindrome("a")).toBe(true); | ||
}); | ||
test("should return true for a single letter repeated", function(){ | ||
expect(isPalindrome("bbb")).toBe(true); | ||
}); | ||
test("should return true for a simple palindome", function(){ | ||
expect(isPalindrome("bib")).toBe(true); | ||
}); | ||
test("should return true for a longer palindrome", function(){ | ||
expect(isPalindrome("racecar")).toBe(true); | ||
}); | ||
}); |
3,631 changes: 3,631 additions & 0 deletions
3,631
unit-testing/chapter-examples/transmission-processor/package-lock.json
Large diffs are not rendered by default.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
unit-testing/chapter-examples/transmission-processor/processor.js
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,5 @@ | ||
function processor(transmission) { | ||
return {}; | ||
} | ||
|
||
module.exports = processor |
7 changes: 7 additions & 0 deletions
7
unit-testing/chapter-examples/transmission-processor/tests/processor.test.js
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 |
---|---|---|
@@ -1,5 +1,12 @@ | ||
const processor = require("../processor.js"); | ||
|
||
describe("transmission processor", function() { | ||
|
||
test("takes a string and returns an object", function() { | ||
let result = processor("9701::<489584872710>"); | ||
expect(typeof(result)).toBe("object"); | ||
|
||
}); | ||
// TODO: put tests here | ||
|
||
}); |
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 |
---|---|---|
|
@@ -8,4 +8,6 @@ function checkFive(num){ | |
result = num + " is greater than 5."; | ||
} | ||
return result; | ||
} | ||
} | ||
|
||
module.exports = checkFive |
Oops, something went wrong.