countSubstring
should be a function.
testString: assert(typeof countSubstring === 'function');
- text: countSubstring("the three truths", "th")
should return 3
.
testString: assert.equal(countSubstring(testCases[0], searchString[0]), results[0]);
- text: countSubstring("ababababab", "abab")
should return 2
.
testString: assert.equal(countSubstring(testCases[1], searchString[1]), results[1]);
- text: countSubstring("abaabba*bbaba*bbab", "a*b")
should return 2
.
testString: assert.equal(countSubstring(testCases[2], searchString[2]), results[2]);
```