Skip to content

Latest commit

 

History

History
277 lines (224 loc) · 5.98 KB

prefer-string-starts-ends-with.js.md

File metadata and controls

277 lines (224 loc) · 5.98 KB

Snapshot report for test/prefer-string-starts-ends-with.js

The actual snapshot is saved in prefer-string-starts-ends-with.js.snap.

Generated by AVA.

prefer-string-starts-ends-with - #1

Snapshot 1

`␊
Input:␊
  1 | /^a/.test("string")␊

Output:␊
  1 | "string".startsWith('a')␊

Error 1/1:␊
> 1 | /^a/.test("string")␊
    | ^^^^^^^^^^^^^^^^^^^ Prefer `String#startsWith()` over a regex with `^`.␊
`

prefer-string-starts-ends-with - #2

Snapshot 1

`␊
Input:␊
  1 | /^a/.test((0, "string"))␊

Output:␊
  1 | (0, "string").startsWith(('a'))␊

Error 1/1:␊
> 1 | /^a/.test((0, "string"))␊
    | ^^^^^^^^^^^^^^^^^^^^^^^^ Prefer `String#startsWith()` over a regex with `^`.␊
`

prefer-string-starts-ends-with - #3

Snapshot 1

`␊
Input:␊
  1 | async function a() {return /^a/.test(await foo())}␊

Output:␊
  1 | async function a() {return (await foo()).startsWith('a')}␊

Error 1/1:␊
> 1 | async function a() {return /^a/.test(await foo())}␊
    |                            ^^^^^^^^^^^^^^^^^^^^^^ Prefer `String#startsWith()` over a regex with `^`.␊
`

prefer-string-starts-ends-with - #4

Snapshot 1

`␊
Input:␊
  1 | /^a/.test(foo + bar)␊

Output:␊
  1 | (foo + bar).startsWith('a')␊

Error 1/1:␊
> 1 | /^a/.test(foo + bar)␊
    | ^^^^^^^^^^^^^^^^^^^^ Prefer `String#startsWith()` over a regex with `^`.␊
`

prefer-string-starts-ends-with - #5

Snapshot 1

`␊
Input:␊
  1 | /^a/.test(foo || bar)␊

Output:␊
  1 | (foo || bar).startsWith('a')␊

Error 1/1:␊
> 1 | /^a/.test(foo || bar)␊
    | ^^^^^^^^^^^^^^^^^^^^^ Prefer `String#startsWith()` over a regex with `^`.␊
`

prefer-string-starts-ends-with - #6

Snapshot 1

`␊
Input:␊
  1 | /^a/.test(new SomeString)␊

Output:␊
  1 | (new SomeString).startsWith('a')␊

Error 1/1:␊
> 1 | /^a/.test(new SomeString)␊
    | ^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer `String#startsWith()` over a regex with `^`.␊
`

prefer-string-starts-ends-with - #7

Snapshot 1

`␊
Input:␊
  1 | /^a/.test(new (SomeString))␊

Output:␊
  1 | (new (SomeString)).startsWith('a')␊

Error 1/1:␊
> 1 | /^a/.test(new (SomeString))␊
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer `String#startsWith()` over a regex with `^`.␊
`

prefer-string-starts-ends-with - #8

Snapshot 1

`␊
Input:␊
  1 | /^a/.test(new SomeString())␊

Output:␊
  1 | new SomeString().startsWith('a')␊

Error 1/1:␊
> 1 | /^a/.test(new SomeString())␊
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer `String#startsWith()` over a regex with `^`.␊
`

prefer-string-starts-ends-with - #9

Snapshot 1

`␊
Input:␊
  1 | /^a/.test(new SomeString(/* comment */))␊

Output:␊
  1 | new SomeString(/* comment */).startsWith('a')␊

Error 1/1:␊
> 1 | /^a/.test(new SomeString(/* comment */))␊
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer `String#startsWith()` over a regex with `^`.␊
`

prefer-string-starts-ends-with - #10

Snapshot 1

`␊
Input:␊
  1 | /^a/.test(new SomeString("string"))␊

Output:␊
  1 | new SomeString("string").startsWith('a')␊

Error 1/1:␊
> 1 | /^a/.test(new SomeString("string"))␊
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer `String#startsWith()` over a regex with `^`.␊
`

prefer-string-starts-ends-with - #11

Snapshot 1

`␊
Input:␊
  1 | /^a/.test(foo.bar)␊

Output:␊
  1 | foo.bar.startsWith('a')␊

Error 1/1:␊
> 1 | /^a/.test(foo.bar)␊
    | ^^^^^^^^^^^^^^^^^^ Prefer `String#startsWith()` over a regex with `^`.␊
`

prefer-string-starts-ends-with - #12

Snapshot 1

`␊
Input:␊
  1 | /^a/.test(foo.bar())␊

Output:␊
  1 | foo.bar().startsWith('a')␊

Error 1/1:␊
> 1 | /^a/.test(foo.bar())␊
    | ^^^^^^^^^^^^^^^^^^^^ Prefer `String#startsWith()` over a regex with `^`.␊
`

prefer-string-starts-ends-with - #13

Snapshot 1

`␊
Input:␊
  1 | /^a/.test(foo?.bar)␊

Output:␊
  1 | foo?.bar.startsWith('a')␊

Error 1/1:␊
> 1 | /^a/.test(foo?.bar)␊
    | ^^^^^^^^^^^^^^^^^^^ Prefer `String#startsWith()` over a regex with `^`.␊
`

prefer-string-starts-ends-with - #14

Snapshot 1

`␊
Input:␊
  1 | /^a/.test(foo?.bar())␊

Output:␊
  1 | foo?.bar().startsWith('a')␊

Error 1/1:␊
> 1 | /^a/.test(foo?.bar())␊
    | ^^^^^^^^^^^^^^^^^^^^^ Prefer `String#startsWith()` over a regex with `^`.␊
`

prefer-string-starts-ends-with - #15

Snapshot 1

`␊
Input:␊
  1 | /^a/.test(`string`)␊

Output:␊
  1 | `string`.startsWith('a')␊

Error 1/1:␊
> 1 | /^a/.test(`string`)␊
    | ^^^^^^^^^^^^^^^^^^^ Prefer `String#startsWith()` over a regex with `^`.␊
`

prefer-string-starts-ends-with - #16

Snapshot 1

`␊
Input:␊
  1 | /^a/.test(tagged`string`)␊

Output:␊
  1 | (tagged`string`).startsWith('a')␊

Error 1/1:␊
> 1 | /^a/.test(tagged`string`)␊
    | ^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer `String#startsWith()` over a regex with `^`.␊
`

prefer-string-starts-ends-with - #17

Snapshot 1

`␊
Input:␊
  1 | (/^a/).test((0, "string"))␊

Output:␊
  1 | (0, "string").startsWith(('a'))␊

Error 1/1:␊
> 1 | (/^a/).test((0, "string"))␊
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer `String#startsWith()` over a regex with `^`.␊
`