Skip to content

Latest commit

 

History

History
181 lines (124 loc) · 3.16 KB

prefer-includes.js.md

File metadata and controls

181 lines (124 loc) · 3.16 KB

Snapshot report for test/prefer-includes.js

The actual snapshot is saved in prefer-includes.js.snap.

Generated by AVA.

Invalid #1

  1 | 'foobar'.indexOf('foo') !== -1

Output

`␊
  1 | 'foobar'.includes('foo')␊
`

Error 1/1

`␊
> 1 | 'foobar'.indexOf('foo') !== -1␊
    |          ^^^^^^^ Use `.includes()`, rather than `.indexOf()`, when checking for existence.␊
`

Invalid #2

  1 | str.indexOf('foo') != -1

Output

`␊
  1 | str.includes('foo')␊
`

Error 1/1

`␊
> 1 | str.indexOf('foo') != -1␊
    |     ^^^^^^^ Use `.includes()`, rather than `.indexOf()`, when checking for existence.␊
`

Invalid #3

  1 | str.indexOf('foo') > -1

Output

`␊
  1 | str.includes('foo')␊
`

Error 1/1

`␊
> 1 | str.indexOf('foo') > -1␊
    |     ^^^^^^^ Use `.includes()`, rather than `.indexOf()`, when checking for existence.␊
`

Invalid #4

  1 | str.indexOf('foo') == -1

Output

`␊
  1 | !str.includes('foo')␊
`

Error 1/1

`␊
> 1 | str.indexOf('foo') == -1␊
    |     ^^^^^^^ Use `.includes()`, rather than `.indexOf()`, when checking for existence.␊
`

Invalid #5

  1 | 'foobar'.indexOf('foo') >= 0

Output

`␊
  1 | 'foobar'.includes('foo')␊
`

Error 1/1

`␊
> 1 | 'foobar'.indexOf('foo') >= 0␊
    |          ^^^^^^^ Use `.includes()`, rather than `.indexOf()`, when checking for existence.␊
`

Invalid #6

  1 | [1,2,3].indexOf(4) !== -1

Output

`␊
  1 | [1,2,3].includes(4)␊
`

Error 1/1

`␊
> 1 | [1,2,3].indexOf(4) !== -1␊
    |         ^^^^^^^ Use `.includes()`, rather than `.indexOf()`, when checking for existence.␊
`

Invalid #7

  1 | str.indexOf('foo') < 0

Output

`␊
  1 | !str.includes('foo')␊
`

Error 1/1

`␊
> 1 | str.indexOf('foo') < 0␊
    |     ^^^^^^^ Use `.includes()`, rather than `.indexOf()`, when checking for existence.␊
`

Invalid #8

  1 | ''.indexOf('foo') < 0

Output

`␊
  1 | !''.includes('foo')␊
`

Error 1/1

`␊
> 1 | ''.indexOf('foo') < 0␊
    |    ^^^^^^^ Use `.includes()`, rather than `.indexOf()`, when checking for existence.␊
`

Invalid #9

  1 | (a || b).indexOf('foo') === -1

Output

`␊
  1 | !(a || b).includes('foo')␊
`

Error 1/1

`␊
> 1 | (a || b).indexOf('foo') === -1␊
    |          ^^^^^^^ Use `.includes()`, rather than `.indexOf()`, when checking for existence.␊
`

Invalid #10

  1 | foo.indexOf(bar, 0) !== -1

Output

`␊
  1 | foo.includes(bar)␊
`

Error 1/1

`␊
> 1 | foo.indexOf(bar, 0) !== -1␊
    |     ^^^^^^^ Use `.includes()`, rather than `.indexOf()`, when checking for existence.␊
`

Invalid #11

  1 | foo.indexOf(bar, 1) !== -1

Output

`␊
  1 | foo.includes(bar, 1)␊
`

Error 1/1

`␊
> 1 | foo.indexOf(bar, 1) !== -1␊
    |     ^^^^^^^ Use `.includes()`, rather than `.indexOf()`, when checking for existence.␊
`