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

Repo: Build failure on main: prefer-readonly.test.ts unit tests #8222

Closed
JoshuaKGoldberg opened this issue Jan 8, 2024 · 3 comments
Closed
Assignees
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working repo maintenance things to do with maintenance of the repo, and not with code/docs

Comments

@JoshuaKGoldberg
Copy link
Member

JoshuaKGoldberg commented Jan 8, 2024

Suggestion

https://github.com/typescript-eslint/typescript-eslint/actions/runs/7450497628/job/20269616606

Summary of all failing tests
 FAIL  tests/rules/prefer-readonly.test.ts (7.204 s, 224 MB heap size)
  ● prefer-readonly › invalid › 
...
There are a few failing tests. Full output here.
Summary of all failing tests
 FAIL  tests/rules/prefer-readonly.test.ts (7.204 s, 224 MB heap size)
  ● prefer-readonly › invalid › 
        class Test {
          private prop: number = 3;
        
          test() {
            const that = {} as this & { _foo: 'bar' };
            that._foo = 1;
          }
        }
      
    assert.strictEqual(received, expected)
    Expected value to strictly be equal to:
      "
            class Test {
              private readonly prop: number = 3·
              test() {
                const that = {} as this & {_foo: 'bar'}
                that._foo = 1
              }
            }
          "
    Received:
      "
            class Test {
              private readonly prop: number = 3;·········
        
          constructor() {
            const that = {} as this & { _foo: 'bar' };
            that.prop = 1;
          }
        }
      
    assert.strictEqual(received, expected)
    Expected value to strictly be equal to:
      "
            class Test {
              private readonly prop: number·
              constructor() {
                const that = {} as this & {_foo: 'bar'}
                that.prop = 1
              }
            }
          "
    Received:
      "
            class Test {
              private readonly prop: number;·········
              constructor() {
                const that = {} as this & { _foo: 'bar' };
                that.prop = 1;
              }
            }
          "
    
    Message:
      Output is incorrect.
    Difference:
    - Expected
    + Received
              class Test {
    -           private readonly prop: number
    -
    +           private readonly prop: number;
    +         
                constructor() {
    -             const that = {} as this & {_foo: 'bar'}
    -             that.prop = 1
    +             const that = {} as this & { _foo: 'bar' };
    +             that.prop = 1;
                }
              }
            

      634 |         }
      635 |         else {
    > 636 |             node_assert_1.default.strictEqual(result.output, item.output, 'Output is incorrect.');
          |                                   ^
      637 |         }
      638 |     }
      639 |     else {

      at RuleTester.strictEqual (../rule-tester/dist/RuleTester.js:636:35)
      at Object.call (../rule-tester/dist/RuleTester.js:237:119)

cc @auvred - the rule was changed in #8169, which at one point did have a passing build but I hadn't noticed it eventually failed on formatting things. No worries on your end, fault on my end for not noticing. I'll fix it up real quick now. We're delayed on releasing anyway from #8220 -> #8221.

@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 Jan 8, 2024
@JoshuaKGoldberg JoshuaKGoldberg self-assigned this Jan 8, 2024
@auvred
Copy link
Member

auvred commented Jan 8, 2024

Oops, I didn't notice that, sorry... I can send a PR with a fix right now if you tell me

@JoshuaKGoldberg
Copy link
Member Author

JoshuaKGoldberg commented Jan 8, 2024

Cillian Murphy as Dr Crane in Batman Begins saying 'Oh it's too late. You can't stop it now.'

For context, I try to make it a habit of sending fixes whenever I broke something - which I consider including approving and/or merging things that caused the error. Responsibility of a maintainer and all that.

@JoshuaKGoldberg
Copy link
Member Author

Fixed by #8223.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 16, 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 repo maintenance things to do with maintenance of the repo, and not with code/docs
Projects
None yet
Development

No branches or pull requests

2 participants