Search code examples
jestjsdiffgit-diff

What meaning yellow diff in jest


test('transform', () => {
  const code = [
    ...
    '  write (i < 10) do',
    ...
  ].join('\n')

  expect(transform(code)).toBe([
    ...
    ' while (i < 10) { ',
    ...
  ].join('\n'))
})

Image with yelloc diff

both line are identical for me


Solution

  • Mean a small diff, solution

    test('transform', () => {
      const code = [
        ...
        '  write (i < 10) do',
        ...
      ].join('\n')
    
      expect(transform(code)).toBe([
        ...
        ' while (i < 10) { ',
        ...
        ''
      ].join('\n'))
    })
    

    references What does "@@ -1 +1 @@" mean in Git's diff output?