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
it("should add a user in memory", () => { | |
userManager.addUser("Dr. Falker", "Joshua"); | |
expect(userManager.loginUser("Dr. Falker", "Joshua")).toBe(true); | |
}); |
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
it("should add a user in memory", () => { | |
userManager.addUser("Dr. Falker", "Joshua"); | |
expect(userManager._users[0].name).toBe("Dr. Falker"); | |
expect(userManager._users[0].password).toBe("Joshua"); | |
}); |
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
it("should return an empty string when passed an empty string", () => { | |
expect(keepUniqueChars("")).toBe(""); | |
}); |
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
it("should suppress all chars that appear multiple times", () => { | |
expect(keepUniqueChars("Hello Fostonic !!")).toBe("HeFstnic"); | |
}); |
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
describe("The RPN expression evaluator", () => { | |
it("should return null when the expression is an empty string", () => { | |
const result = RPN(""); | |
expect(result).toBeNull(); | |
}); | |
it("should return the same value when the expression holds a single value", () => { | |
const result = RPN("42"); | |
expect(result).toBe(42); | |
}); | |
it("should properly calculate an expression", () => { |
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
// Reverse Polish Notation, add 3 and 4, one would write 3 4 + rather than 3 + 4 | |
it("should properly calculate a RPN expression", () => { | |
const result = RPN("5 1 2 + 4 * - 10 /"); | |
expect(result).toBe(-0.7); | |
}); |
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
it('should send the profile data to the server', () => { // expect(...)to(...); }); | |
it('should update the profile view properly', () => { // expect(...)to(...);}); |
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
it("should send the profile data to the server and update the profile view properly", () => { | |
// expect(...)to(...); | |
// expect(...)to(...); | |
}); |
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
it("should call once a method with the proper arguments", () => { | |
const foo = jasmine.createSpyObj("foo", ["bar", "baz"]); | |
foo.bar("baz"); | |
expect(foo.bar).toHaveBeenCalledWith("baz"); | |
}); |
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
it("should call a method with the proper arguments", () => { | |
const foo = { | |
bar: jasmine.createSpy(), | |
baz: jasmine.createSpy(), | |
}; | |
foo.bar("qux"); | |
expect(foo.bar).toHaveBeenCalled(); | |
expect(foo.bar.calls.argsFor(0)).toEqual(["qux"]); | |
}); |
NewerOlder