Skip to content

Repo: Failing integration tests for primary Nodejs version on main #10322

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

Closed
JoshuaKGoldberg opened this issue Nov 11, 2024 · 2 comments · Fixed by #10328
Closed

Repo: Failing integration tests for primary Nodejs version on main #10322

JoshuaKGoldberg opened this issue Nov 11, 2024 · 2 comments · Fixed by #10328
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working locked due to age Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing. repo maintenance things to do with maintenance of the repo, and not with code/docs

Comments

@JoshuaKGoldberg
Copy link
Member

Suggestion

Example from #10320 -> https://github.com/typescript-eslint/typescript-eslint/actions/runs/11779291570/job/32807644519?pr=10320 -> https://cloud.nx.app/runs/BZlulN2Fcq:

 FAIL  tests/flat-config-types-@types__eslint-v9.test.ts (54.721 s)
  ● flat-config-types-@types__eslint-v9 › typescript › should work successfully

    expect(received).toHaveLength(expected)

    Expected length: 0
    Received length: 1
    Received array:  ["eslint.config.js(65,8): error TS2461: Type 'FlatConfig' is not an array type."]

      23 |
      24 |       // The types should not error (e.g. https://github.com/eslint-stylistic/eslint-stylistic/issues/276)
    > 25 |       expect(lines).toHaveLength(0);
         |                     ^
      26 |     },
      27 |   );
      28 | }

      at toHaveLength (tests/flat-config-types-@types__eslint-v9.test.ts:25:21)
      at assertOutput (tools/integration-test-base.ts:197:7)
      at Object.<anonymous> (tools/integration-test-base.ts:120:9)
Full failing test complaints
 FAIL  tests/flat-config-types-@types__eslint-v9.test.ts (54.721 s)
  ● flat-config-types-@types__eslint-v9 › typescript › should work successfully

    expect(received).toHaveLength(expected)

    Expected length: 0
    Received length: 1
    Received array:  ["eslint.config.js(65,8): error TS2461: Type 'FlatConfig' is not an array type."]

      23 |
      24 |       // The types should not error (e.g. https://github.com/eslint-stylistic/eslint-stylistic/issues/276)
    > 25 |       expect(lines).toHaveLength(0);
         |                     ^
      26 |     },
      27 |   );
      28 | }

      at toHaveLength (tests/flat-config-types-@types__eslint-v9.test.ts:25:21)
      at assertOutput (tools/integration-test-base.ts:197:7)
      at Object.<anonymous> (tools/integration-test-base.ts:120:9)

  ● flat-config-types-@types__eslint-v9 › typescript with --strictNullChecks › should work successfully

    expect(received).toHaveLength(expected)

    Expected length: 0
    Received length: 1
    Received array:  ["eslint.config.js(65,8): error TS2461: Type 'FlatConfig' is not an array type."]

      23 |
      24 |       // The types should not error (e.g. https://github.com/eslint-stylistic/eslint-stylistic/issues/276)
    > 25 |       expect(lines).toHaveLength(0);
         |                     ^
      26 |     },
      27 |   );
      28 | }

      at toHaveLength (tests/flat-config-types-@types__eslint-v9.test.ts:25:21)
      at assertOutput (tools/integration-test-base.ts:197:7)
      at Object.<anonymous> (tools/integration-test-base.ts:120:9)

  ● flat-config-types-@types__eslint-v9 › typescript with --strictNullChecks, --exactOptionalPropertyTypes › should work successfully

    expect(received).toHaveLength(expected)

    Expected length: 0
    Received length: 1
    Received array:  ["eslint.config.js(65,8): error TS2461: Type 'FlatConfig' is not an array type."]

      23 |
      24 |       // The types should not error (e.g. https://github.com/eslint-stylistic/eslint-stylistic/issues/276)
    > 25 |       expect(lines).toHaveLength(0);
         |                     ^
      26 |     },
      27 |   );
      28 | }

      at toHaveLength (tests/flat-config-types-@types__eslint-v9.test.ts:25:21)
      at assertOutput (tools/integration-test-base.ts:197:7)
      at Object.<anonymous> (tools/integration-test-base.ts:120:9)

 FAIL  tests/flat-config-types-@types__eslint-v8.test.ts (47.534 s)
  ● flat-config-types-@types__eslint-v8 › typescript › should work successfully

    expect(received).toHaveLength(expected)

    Expected length: 0
    Received length: 1
    Received array:  ["eslint.config.js(65,8): error TS2461: Type 'FlatConfig<RulesRecord>' is not an array type."]

      23 |
      24 |       // The types should not error (e.g. https://github.com/eslint-stylistic/eslint-stylistic/issues/276)
    > 25 |       expect(lines).toHaveLength(0);
         |                     ^
      26 |     },
      27 |   );
      28 | }

      at toHaveLength (tests/flat-config-types-@types__eslint-v8.test.ts:25:21)
      at assertOutput (tools/integration-test-base.ts:197:7)
      at Object.<anonymous> (tools/integration-test-base.ts:120:9)

  ● flat-config-types-@types__eslint-v8 › typescript with --strictNullChecks › should work successfully

    expect(received).toHaveLength(expected)

    Expected length: 0
    Received length: 1
    Received array:  ["eslint.config.js(65,8): error TS2461: Type 'FlatConfig<RulesRecord>' is not an array type."]

      23 |
      24 |       // The types should not error (e.g. https://github.com/eslint-stylistic/eslint-stylistic/issues/276)
    > 25 |       expect(lines).toHaveLength(0);
         |                     ^
      26 |     },
      27 |   );
      28 | }

      at toHaveLength (tests/flat-config-types-@types__eslint-v8.test.ts:25:21)
      at assertOutput (tools/integration-test-base.ts:197:7)
      at Object.<anonymous> (tools/integration-test-base.ts:120:9)

  ● flat-config-types-@types__eslint-v8 › typescript with --strictNullChecks, --exactOptionalPropertyTypes › should work successfully

    expect(received).toHaveLength(expected)

    Expected length: 0
    Received length: 1
    Received array:  ["eslint.config.js(65,8): error TS2461: Type 'FlatConfig<RulesRecord>' is not an array type."]

      23 |
      24 |       // The types should not error (e.g. https://github.com/eslint-stylistic/eslint-stylistic/issues/276)
    > 25 |       expect(lines).toHaveLength(0);
         |                     ^
      26 |     },
      27 |   );
      28 | }

      at toHaveLength (tests/flat-config-types-@types__eslint-v8.test.ts:25:21)
      at assertOutput (tools/integration-test-base.ts:197:7)
      at Object.<anonymous> (tools/integration-test-base.ts:120:9)

Additional Info

:sparkling

@JoshuaKGoldberg JoshuaKGoldberg added bug Something isn't working repo maintenance things to do with maintenance of the repo, and not with code/docs accepting prs Go ahead, send a pull request that resolves this issue labels Nov 11, 2024
@ronami
Copy link
Member

ronami commented Nov 11, 2024

@JoshuaKGoldberg looks like it's jest-community/eslint-plugin-jest#1667, which was released a few days ago in v28.9.0.

To my understanding, the tests install the latest version of eslint-plugin-jest. This, combined with the now invalid type usage makes this fail (jestPlugin.configs['flat/recommended'] is an object, but not an array). The docs do suggest valid code for adding this (under Usage with other plugins).

I see a few ways to solve this:

  • Use the same version of eslint-plugin-jest currently installed on the monorepo (which may help with future issues like this).
  • Fix the invalid usage of types on the fixtures / add a @ts-expect-error comment.

Or potentially something else that I'm missing. I'll be happy to push a fix with whichever option is preferred.

@JoshuaKGoldberg
Copy link
Member Author

Fix the invalid usage of types on the fixtures

👍 from me on this, if we're using the downstream library incorrectly then we should fix that. Thanks for the investigation!

@github-actions github-actions bot added the locked due to age Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing. label Nov 22, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working locked due to age Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing. repo maintenance things to do with maintenance of the repo, and not with code/docs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants