typescript icon indicating copy to clipboard operation
typescript copied to clipboard

word-count exercise tests not aligned with README instructions

Open pawel-tomkiel opened this issue 4 years ago • 1 comments

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:

  1. A number composed of one or more ASCII digits (ie "0" or "1234") OR
  2. A simple word composed of one or more ASCII letters (ie "a" or "they") OR
  3. 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 😇

pawel-tomkiel avatar Oct 16 '21 21:10 pawel-tomkiel

I created PR with one-line fix: https://github.com/exercism/typescript/pull/876

pawel-tomkiel avatar Dec 17 '21 19:12 pawel-tomkiel