Created
September 11, 2018 19:57
-
-
Save dgg/e96e62ac21621c1b117b6a5dff6a3b11 to your computer and use it in GitHub Desktop.
test-last-ts
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("leftFromFirst", () => { | |
const testSpec = [ | |
{args: [null, "lazy lazy fox jumped"], value : null, desc : "substring not found"}, | |
//{args: ["", "lazy lazy fox jumped"], value : null, desc : "substring not found"}, | |
{args: [null, ""], value : null, desc : "(null, '') --> null"}, | |
{args: [null, null], value : null, desc : "(null, null) --> null"}, | |
{args: [null, null], value : null, desc : "(null, null) --> null"}, | |
//{args: ["", ""], value : null, desc : "(*, '') --> ''"}, | |
//{args: ["", null], value : '', desc : "(*, null) --> ''"}, | |
] | |
testSpec.forEach(t => { | |
it(`conforms to spec [${t.desc}]`, ()=>{ | |
expect(subject.leftFromFirst.apply(null, t.args)).to.equal(t.value) | |
}) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment