Skip to content

Commit ae304c1

Browse files
Unit testing chapter examples completed
1 parent e4262a0 commit ae304c1

File tree

4,216 files changed

+395487
-10
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,216 files changed

+395487
-10
lines changed
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
const hello = require('../hello.js');
22

3-
describe("hello world test", function(){
3+
describe("hello world test", function () {
44

5-
test("should return a custom message when name is specified", function(){
6-
expect(hello("Jest")).toBe("Hello, Jest!");
7-
});
5+
test("should return a custom message when name is specified", function () {
6+
expect(hello("Jest")).toBe("Hello, Jest!");
7+
});
88

9-
it("should return a general greeting when name is not specified", function(){
10-
expect(hello()).toBe("Hello, World!");
11-
});
9+
test("should return a general greeting when name is not specified", function () {
10+
expect(hello()).toBe("Hello, World!");
11+
});
1212

1313
});
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
const isPalindrome = require('../palindrome.js');
2+
3+
describe("testing isPalindrome", function () {
4+
5+
test("should return true for a single letter", function () {
6+
expect(isPalindrome("a")).toBe(true);
7+
});
8+
9+
test("should return true for a single letter repeated", function () {
10+
expect(isPalindrome("aaa")).toBe(true);
11+
});
12+
13+
test("should return true for a simple palindrome", function () {
14+
expect(isPalindrome("aba")).toBe(true);
15+
});
16+
17+
test("should return true for a longer palindrome", function () {
18+
expect(isPalindrome("racecar")).toBe(true);
19+
});
20+
21+
test("should return false for a longer non-palindrome", function () {
22+
expect(isPalindrome("launchcode")).toBe(false);
23+
});
24+
25+
test("should return false for a simple non-palindrome", function () {
26+
expect(isPalindrome("ab")).toBe(false);
27+
});
28+
29+
test("should be case-sensitive", function () {
30+
expect(isPalindrome("abA")).toBe(false);
31+
});
32+
33+
test("should consider whitespace", function () {
34+
expect(isPalindrome("so many dynamos")).toBe(false);
35+
});
36+
37+
test("should consider the empty string a palindrome", function() {
38+
expect(isPalindrome("")).toBe(true);
39+
});
40+
41+
});
42+

unit-testing/chapter-examples/transmission-processor/node_modules/.bin/browserslist

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unit-testing/chapter-examples/transmission-processor/node_modules/.bin/browserslist.cmd

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unit-testing/chapter-examples/transmission-processor/node_modules/.bin/browserslist.ps1

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unit-testing/chapter-examples/transmission-processor/node_modules/.bin/create-jest

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unit-testing/chapter-examples/transmission-processor/node_modules/.bin/create-jest.cmd

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unit-testing/chapter-examples/transmission-processor/node_modules/.bin/create-jest.ps1

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unit-testing/chapter-examples/transmission-processor/node_modules/.bin/esparse

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unit-testing/chapter-examples/transmission-processor/node_modules/.bin/esparse.cmd

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unit-testing/chapter-examples/transmission-processor/node_modules/.bin/esparse.ps1

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unit-testing/chapter-examples/transmission-processor/node_modules/.bin/esvalidate

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unit-testing/chapter-examples/transmission-processor/node_modules/.bin/esvalidate.cmd

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unit-testing/chapter-examples/transmission-processor/node_modules/.bin/esvalidate.ps1

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unit-testing/chapter-examples/transmission-processor/node_modules/.bin/import-local-fixture

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unit-testing/chapter-examples/transmission-processor/node_modules/.bin/import-local-fixture.cmd

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unit-testing/chapter-examples/transmission-processor/node_modules/.bin/import-local-fixture.ps1

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)