Skip to content

Repo: Failure on main: Run Unit Tests with Experimental TSServer (eslint-plugin)  #8131

Closed
@JoshuaKGoldberg

Description

@JoshuaKGoldberg

Suggestion

It started after merging #7752. https://github.com/typescript-eslint/typescript-eslint/actions/runs/7317242945/job/19932592486:

Summary of all failing tests
 FAIL  tests/rules/no-unused-vars/no-unused-vars-eslint.test.ts (17.679 s, 1025 MB heap size)
  ● no-unused-vars › invalid › 
/*global ����, ��*/
����;
      
    assert(received)
    Expected value to be equal to:
      true
    Received:
      false
    
    Message:
      A fatal parsing error occurred: Parsing error: Invalid character.

      356 |         }
      357 |         const fatalErrorMessage = messages.find(m => m.fatal);
    > 358 |         (0, node_assert_1.default)(!fatalErrorMessage, `A fatal parsing error occurred: ${fatalErrorMessage?.message}`);
          |                                 ^
      359 |         // Verify if autofix makes a syntax error or not.
      360 |         if (messages.some(m => m.fix)) {
      361 |             output = SourceCodeFixer.applyFixes(code, messages).output;

      at RuleTester.runRuleForItem (../rule-tester/dist/RuleTester.js:358:33)
      at RuleTester.runRuleForItem (../rule-tester/dist/RuleTester.js:503:25)
    Message:
      A fatal parsing error occurred: Parsing error: Invalid character.

      356 |         }
      357 |         const fatalErrorMessage = messages.find(m => m.fatal);
    > 358 |         (0, node_assert_1.default)(!fatalErrorMessage, `A fatal parsing error occurred: ${fatalErrorMessage?.message}`);
          |                                 ^
      359 |         // Verify if autofix makes a syntax error or not.
      360 |         if (messages.some(m => m.fix)) {
      361 |             output = SourceCodeFixer.applyFixes(code, messages).output;

      at RuleTester.runRuleForItem (../rule-tester/dist/RuleTester.js:358:33)
      at RuleTester.runRuleForItem (../rule-tester/dist/RuleTester.js:503:25)
      at Object.call (../rule-tester/dist/RuleTester.js:237:119)
 FAIL  tests/eslint-rules/no-undef.test.ts (13.747 s, 631 MB heap size)
  ● no-undef › valid › 
interface IteratorCallback<Subject, Key, Value> {
  (this: Subject, value: Value, key: Key, subject: Subject): void | false;
}
function eachr<Value>(
  subject: Array<Value>,
  callback: IteratorCallback<typeof subject, number, Value>,
): typeof subject;
function eachr<Key, Value>(
  subject: Map<Key, Value>,
  callback: IteratorCallback<typeof subject, Key, Value>,
): typeof subject;
function eachr<Object extends object, Key extends keyof Object>(
  subject: Object,
  callback: IteratorCallback<Object, Key, Object[Key]>,
): Object;
function eachr<Object extends object, Key, Value>(
  subject: Object | Array<Value> | Map<Key, Value>,
  callback: IteratorCallback<typeof subject, Key, Value>,
): typeof subject {
  return subject;
}
    
    assert.strictEqual(received, expected)
    Expected value to strictly be equal to:
      0
    Received:
      2
    
    Message:
      Should have no errors but had 2: [
      {
        ruleId: 'no-undef',
        severity: 2,
        message: "'Map' is not defined.",
        line: 10,
        column: 12,
        nodeType: 'Identifier',
        messageId: 'undef',
        endLine: 10,
        endColumn: 15
      },
      {
        ruleId: 'no-undef',
        severity: 2,
        message: "'Map' is not defined.",
        line: 18,
        column: 36,
        nodeType: 'Identifier',
        messageId: 'undef',
        endLine: 18,
        endColumn: 39
      }
    ]

      484 |     const result = this.runRuleForItem(ruleName, rule, item);
      485 |     const messages = result.messages;
    > 486 |     node_assert_1.default.strictEqual(messages.length, 0, node_util_1.default.format('Should have no errors but had %d: %s', messages.length, node_util_1.default.inspect(messages)));
          |                           ^
      487 |     assertASTDidntChange(result.beforeAST, result.afterAST);
      488 | }, _RuleTester_testInvalidTemplate = function _RuleTester_testInvalidTemplate(ruleName, rule, item) {
      489 |     node_assert_1.default.ok(typeof item.code === 'string', "Test case must specify a string value for 'code'");

      at RuleTester.strictEqual (../rule-tester/dist/RuleTester.js:486:27)
      at Object.call (../rule-tester/dist/RuleTester.js:222:117)
  ● no-undef › valid › 
function eachr<Key, Value>(subject: Map<Key, Value>): typeof subject;
    
    assert.strictEqual(received, expected)
    Expected value to strictly be equal to:
      0
    Received:
      1
    
    Message:
      Should have no errors but had 1: [
      {
        ruleId: 'no-undef',
        severity: 2,
        message: "'Map' is not defined.",
        line: 2,
        column: 37,
        nodeType: 'Identifier',
        messageId: 'undef',
        endLine: 2,
        endColumn: 40
      }
    ]

      484 |     const result = this.runRuleForItem(ruleName, rule, item);
      485 |     const messages = result.messages;
    > 486 |     node_assert_1.default.strictEqual(messages.length, 0, node_util_1.default.format('Should have no errors but had %d: %s', messages.length, node_util_1.default.inspect(messages)));
          |                           ^
      487 |     assertASTDidntChange(result.beforeAST, result.afterAST);
      488 | }, _RuleTester_testInvalidTemplate = function _RuleTester_testInvalidTemplate(ruleName, rule, item) {
      489 |     node_assert_1.default.ok(typeof item.code === 'string', "Test case must specify a string value for 'code'");

      at RuleTester.strictEqual (../rule-tester/dist/RuleTester.js:486:27)
      at Object.call (../rule-tester/dist/RuleTester.js:222:117)
Test Suites: 3 failed, 174 passed, 177 total
Tests:       5 failed, 1 skipped, 28600 passed, 28606 total
Snapshots:   136 passed, 136 total
Time:        822.794 s
Ran all test suites.

I honestly thought this was some kind of weird merge conflict. Seemed odd to me that the change would cause it. Sigh.

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workingrepo maintenancethings to do with maintenance of the repo, and not with code/docs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy