Skip to content

Instantly share code, notes, and snippets.

@gangsthub
Last active July 4, 2019 16:32
Show Gist options
  • Save gangsthub/c61267d21bd87d7312c10fda75364602 to your computer and use it in GitHub Desktop.
Save gangsthub/c61267d21bd87d7312c10fda75364602 to your computer and use it in GitHub Desktop.
A11y porpuse gists (for embedded code images)
// ⚡️
funFunction.bind(this).call()
// is the same as
funFunction.call(this)
// 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