Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test failures with eslint 5.11 #22

Closed
JamesHenry opened this issue Jan 15, 2019 · 1 comment
Closed

Test failures with eslint 5.11 #22

JamesHenry opened this issue Jan 15, 2019 · 1 comment
Labels
package: parser Issues related to @typescript-eslint/parser

Comments

@JamesHenry
Copy link
Member

This issue was initially reported here: eslint/typescript-eslint-parser#585


What version of TypeScript are you using?
3.2.1

What version of typescript-eslint-parser are you using?
eslint/typescript-eslint-parser#584

This may not at all be important however I did notice that if I bump eslint to the latest version the test suite fails.

jest "--updateSnapshot"

 PASS  tests/lib/jsx.js
 FAIL  tests/lib/tsx.js
  ● TSX › if the filename ends with '.tsx', enable jsx option automatically. › filePath was not provided

    expect(received).toStrictEqual(expected)

    Expected value to equal:
      [{"column": 18, "fatal": true, "line": 1, "message": "Parsing error: '>' expected.", "ruleId": null, "severity": 2, "source": "const element = <T/>"}]
    Received:
      [{"column": 18, "fatal": true, "line": 1, "message": "Parsing error: '>' expected.", "ruleId": null, "severity": 2}]

    Difference:

    - Expected
    + Received

    @@ -4,8 +4,7 @@
          "fatal": true,
          "line": 1,
          "message": "Parsing error: '>' expected.",
          "ruleId": null,
          "severity": 2,
    -     "source": "const element = <T/>",
        },
      ]

      55 |             const messages = linter.verify(code, config);
      56 |
    > 57 |             expect(messages).toStrictEqual([{
         |                              ^
      58 |                 column: 18,
      59 |                 fatal: true,
      60 |                 line: 1,

      at Object.toStrictEqual (tests/lib/tsx.js:57:30)

  ● TSX › if the filename ends with '.tsx', enable jsx option automatically. › test.ts

    expect(received).toStrictEqual(expected)

    Expected value to equal:
      [{"column": 18, "fatal": true, "line": 1, "message": "Parsing error: '>' expected.", "ruleId": null, "severity": 2, "source": "const element = <T/>"}]
    Received:
      [{"column": 18, "fatal": true, "line": 1, "message": "Parsing error: '>' expected.", "ruleId": null, "severity": 2}]

    Difference:

    - Expected
    + Received

    @@ -4,8 +4,7 @@
          "fatal": true,
          "line": 1,
          "message": "Parsing error: '>' expected.",
          "ruleId": null,
          "severity": 2,
    -     "source": "const element = <T/>",
        },
      ]

      86 |             const messages = linter.verify(code, config, { filename: "test.ts" });
      87 |
    > 88 |             expect(messages).toStrictEqual([{
         |                              ^
      89 |                 column: 18,
      90 |                 fatal: true,
      91 |                 line: 1,

      at Object.toStrictEqual (tests/lib/tsx.js:88:30)

  ● TSX › if the filename ends with '.tsx', enable jsx option automatically. › test.ts with 'jsx:true' option

    expect(received).toStrictEqual(expected)

    Expected value to equal:
      [{"column": 18, "fatal": true, "line": 1, "message": "Parsing error: '>' expected.", "ruleId": null, "severity": 2, "source": "const element = <T/>"}]
    Received:
      [{"column": 18, "fatal": true, "line": 1, "message": "Parsing error: '>' expected.", "ruleId": null, "severity": 2}]

    Difference:

    - Expected
    + Received

    @@ -4,8 +4,7 @@
          "fatal": true,
          "line": 1,
          "message": "Parsing error: '>' expected.",
          "ruleId": null,
          "severity": 2,
    -     "source": "const element = <T/>",
        },
      ]

      107 |             const messages = linter.verify(code, config, { filename: "test.ts" });
      108 |
    > 109 |             expect(messages).toStrictEqual([{
          |                              ^
      110 |                 column: 18,
      111 |                 fatal: true,
      112 |                 line: 1,

      at Object.toStrictEqual (tests/lib/tsx.js:109:30)

 PASS  tests/lib/scope-analysis.js
 FAIL  tests/lib/basics.js
  ● basics › https://github.com/eslint/typescript-eslint-parser/issues/476

    expect(received).toStrictEqual(expected)

    Expected value to equal:
      [{"column": 21, "endColumn": 42, "endLine": 2, "line": 2, "message": "called on React.SFC", "nodeType": "TSTypeReference", "ruleId": "test", "severity": 2, "source": "export const Price: React.SFC<PriceProps> = function Price(props) {}"}, {"column": 31, "endColumn": 41, "endLine": 2, "line": 2, "message": "called on PriceProps", "nodeType": "TSTypeReference", "ruleId": "test", "severity": 2, "source": "export const Price: React.SFC<PriceProps> = function Price(props) {}"}]
    Received:
      [{"column": 21, "endColumn": 42, "endLine": 2, "line": 2, "message": "called on React.SFC", "nodeType": "TSTypeReference", "ruleId": "test", "severity": 2}, {"column": 31, "endColumn": 41, "endLine": 2, "line": 2, "message": "called on PriceProps", "nodeType": "TSTypeReference", "ruleId": "test", "severity": 2}]

    Difference:

    - Expected
    + Received

    @@ -6,19 +6,17 @@
          "line": 2,
          "message": "called on React.SFC",
          "nodeType": "TSTypeReference",
          "ruleId": "test",
          "severity": 2,
    -     "source": "export const Price: React.SFC<PriceProps> = function Price(props) {}",
        },
        Object {
          "column": 31,
          "endColumn": 41,
          "endLine": 2,
          "line": 2,
          "message": "called on PriceProps",
          "nodeType": "TSTypeReference",
          "ruleId": "test",
          "severity": 2,
    -     "source": "export const Price: React.SFC<PriceProps> = function Price(props) {}",
        },
      ]

      67 |         const messages = linter.verify(code, config, { filename: "issue.ts" });
      68 |
    > 69 |         expect(messages).toStrictEqual([
         |                          ^
      70 |             {
      71 |                 column: 21,
      72 |                 endColumn: 42,

      at Object.toStrictEqual (tests/lib/basics.js:69:26)
@JamesHenry
Copy link
Member Author

I believe this should be resolved in v1.0.0

@typescript-eslint typescript-eslint locked as resolved and limited conversation to collaborators Feb 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: parser Issues related to @typescript-eslint/parser
Projects
None yet
Development

No branches or pull requests

1 participant