typescript
typescript copied to clipboard
word-count exercise tests not aligned with README instructions
word-count exercise instructions specify word as a:
For the purposes of this exercise you can expect that a word will always be one of:
- A number composed of one or more ASCII digits (ie "0" or "1234") OR
- A simple word composed of one or more ASCII letters (ie "a" or "they") OR
- A contraction of two simple words joined by a single apostrophe (ie "it's" or "they're")
Tests however expect it to include also symbols and treat 'javascript!!&@$%^&' as a word:
xit('includes punctuation', () => {
const expectedCounts = new Map(
Object.entries({
car: 1,
':': 2,
carpet: 1,
as: 1,
java: 1,
'javascript!!&@$%^&': 1,
})
)
expect(count('car : carpet as java : javascript!!&@$%^&')).toEqual(
expectedCounts
)
})
I guess we should make it consistent 😇
I created PR with one-line fix: https://github.com/exercism/typescript/pull/876