Skip to content

Instantly share code, notes, and snippets.

@hanmd82
Created January 3, 2018 06:12
Show Gist options
  • Save hanmd82/6207d68ee4bb8a478fd32aa40a4adefe to your computer and use it in GitHub Desktop.
Save hanmd82/6207d68ee4bb8a478fd32aa40a4adefe to your computer and use it in GitHub Desktop.
ES6 katas for Unicode - http://es6katas.org/
// 17: unicode - in strings
describe('unicode strings', () => {
it('are \\u prefixed', () => {
const nuclear = `\u2622`;
assert.equal(nuclear, '☢');
});
it('value is 4 bytes/digits', () => {
const nuclear = '\u2622';
assert.equal(`no more ${nuclear}`, 'no more ☢');
});
it('value is hexadecimal', () => {
const nuclear = `\u006E\u006F more \u2622`;
assert.equal(nuclear, 'no more ☢');
});
it('curly braces may surround the value', () => {
const nuclear = `\u{0000000006E}\u{00006F} more \u2622`;
assert.equal(nuclear, 'no more ☢');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment