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] SlackLogger test compilation error #11

Open
mrpastewart opened this issue Jan 5, 2025 · 0 comments
Open

[Test] SlackLogger test compilation error #11

mrpastewart opened this issue Jan 5, 2025 · 0 comments
Labels
Type: Test A problem or enhancement related to a test.

Comments

@mrpastewart
Copy link
Contributor

Select package

Log

Which jobs/test(s) are failing

test/drivers/slack_logger_test.dart

Reason for failure/description

The SlackLogger test file fails to load due to compilation errors when trying to assign to a constructor:

Failed to load "test/drivers/slack_logger_test.dart":
test/drivers/slack_logger_test.dart:38:23: Error: Can't assign to this.
      http.Client.new = () => httpClient;

test/drivers/slack_logger_test.dart:134:23: Error: Can't assign to this.
      http.Client.new = () => httpClient;

The error occurs in two places where the test is attempting to mock the HTTP client by assigning to its constructor, which is not allowed in Dart.

Is this a regression?

No

Media proof

00:01 +0 -18: loading test/drivers/slack_logger_test.dart [E]
  Failed to load "test/drivers/slack_logger_test.dart":
  test/drivers/slack_logger_test.dart:38:23: Error: Can't assign to this.
        http.Client.new = () => httpClient;

Additional context

  • Location: packages/log/test/drivers/slack_logger_test.dart
  • This is a compilation error rather than a runtime test failure
  • The test is attempting to mock HTTP client behavior incorrectly
  • The error appears in two different test cases within the same file
@mrpastewart mrpastewart added the Type: Test A problem or enhancement related to a test. label Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Test A problem or enhancement related to a test.
Projects
None yet
Development

No branches or pull requests

1 participant