Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Tests: RuleTester tests contains outdated snapshot with incorrect test case filename #9732

Closed
Labels
accepting prsGo ahead, send a pull request that resolves this issuelocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.testsanything to do with testing
@auvred

Description

@auvred

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I havesearched for related issues and found none that matched my issue.
  • I haveread the FAQ and my problem is not listed.

Relevant Package

rule-tester

Expected Result

Run

$ cd packages/rule-tester; yarn run test

without any errors.

Actual Result

$ cd packages/rule-tester; yarn run testPASS tests/flat-config-schema.test.tsFAIL tests/RuleTester.test.ts  ● RuleTester › filenames › automatically sets the filename for tests    expect(received).toMatchInlineSnapshot(snapshot)    Snapshot name: `RuleTester filenames automatically sets the filename for tests 1`    - Snapshot  - 1    + Received  + 6    @@ -17,11 +17,16 @@            },          },        },        {          "code": "explicit filename shouldn't be overwritten",    -     "filename": "/set/in/the/test.ts",    +     "filename": "/some/path/that/totally/exists/set/in/the/test.ts",    +     "languageOptions": {    +       "parserOptions": {    +         "disallowAutomaticSingleRunInference": true,    +       },    +     },        },        {          "code": "jsx should have the correct filename",          "filename": "/some/path/that/totally/exists/react.tsx",          "languageOptions": {      192 |       });      193 |    > 194 |       expect(getTestConfigFromCall()).toMatchInlineSnapshot(`          |                                       ^      195 |         [      196 |           {      197 |             "code": "string based valid test",      at Object.toMatchInlineSnapshot (tests/RuleTester.test.ts:194:39) › 1 snapshot failed.Snapshot Summary › 1 snapshot failed from 1 test suite. Inspect your code changes or run `yarn run npx -u` to update them.Test Suites: 1 failed, 1 passed, 2 totalTests:       1 failed, 51 passed, 52 totalSnapshots:   1 failed, 8 passed, 9 totalTime:        1.622 s, estimated 2 sRan all test suites.

The most interesting part is:

    -     "filename": "/set/in/the/test.ts",    +     "filename": "/some/path/that/totally/exists/set/in/the/test.ts",

Additional Info

rule-tester package is not currently being tested in CI (see#9005). That's why this issue was unnoticed.


After bisecting, it turns out that this test case doesn't work after#9678.

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuelocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.testsanything to do with testing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp