Created
November 18, 2017 03:47
-
-
Save flackend/af6b41e6f55dfa7ee59a249480f963af to your computer and use it in GitHub Desktop.
This file contains hidden or 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("anyOtherFunctionName", function() { | |
it("should not use indexOf", function() { | |
var body = anyOtherFunctionName.toString(); | |
expect(/indexOf/.test(body)).toBe(false); | |
expect(anyOtherFunctionName("a", "I am a hacker")).toBe(2); | |
}); | |
it("should return a number", function() { | |
expect(typeof anyOtherFunctionName("a", "I am a hacker")).toBe("number"); | |
}); | |
it("should return the index of the first occurence of a string", function() { | |
expect(anyOtherFunctionName("a", "I am a hacker")).toBe(2); | |
}); | |
it("should return -1 when the character does not occur in the string", function() { | |
expect(anyOtherFunctionName("x", "I am a hacker")).toBe(-1); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment