Last active
July 4, 2019 16:32
-
-
Save paulmelero/c61267d21bd87d7312c10fda75364602 to your computer and use it in GitHub Desktop.
A11y porpuse gists (for embedded code images)
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
// ⚡️ | |
funFunction.bind(this).call() | |
// is the same as | |
funFunction.call(this) |
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
// Example of test case using maps to organize different scenarios and expected values | |
describe('separateCamel', () => { | |
it('transforms camelCase strings to separate strings', () => { | |
// setup | |
const cases = new Map([ | |
['camelCase', 'camel Case'], | |
['camelCaseString', 'camel Case String'], | |
]) | |
for (const [source, expected] of cases.entries()) { | |
// act | |
const actual = separateCamel(source) | |
// assert | |
expect(actual).toBe(expected) | |
} | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment