Conversation
|
Proposed fix for #373 |
Remove
|
| } | ||
|
|
||
| // INFO: - copied from Date.swift | ||
| public extension Date { |
There was a problem hiding this comment.
Copied wholesale from Date.swift - a Common module with shared utilities across the test/source targets might be a better pattern here but seems overkill for just this extension.
| } | ||
|
|
||
| init(millisecondsSinceEpoch: Int64) { | ||
| self.init(timeIntervalSince1970: TimeInterval(millisecondsSinceEpoch / 1_000_000_000)) |
There was a problem hiding this comment.
🟢 Low
XMTPTestHelpers/TestHelpers.swift:119 The divisor 1_000_000_000 converts nanoseconds, not milliseconds. Consider using 1_000 to match the parameter name.
| self.init(timeIntervalSince1970: TimeInterval(millisecondsSinceEpoch / 1_000_000_000)) | |
| self.init(timeIntervalSince1970: TimeInterval(millisecondsSinceEpoch / 1_000)) |
🚀 Want me to fix this? Reply ex: "fix it for me".
🤖 Prompt for AI
In file Sources/XMTPTestHelpers/TestHelpers.swift around line 119:
The divisor `1_000_000_000` converts nanoseconds, not milliseconds. Consider using `1_000` to match the parameter name.
Evidence trail:
Sources/XMTPTestHelpers/TestHelpers.swift lines 117-120 at commit 6b1016e1e20f5cc786b57d6aafaad72bfb94c789: `init(millisecondsSinceEpoch: Int64) { self.init(timeIntervalSince1970: TimeInterval(millisecondsSinceEpoch / 1_000_000_000)) }`. The parameter is named `millisecondsSinceEpoch` but the divisor 1_000_000_000 converts nanoseconds to seconds, not milliseconds. Milliseconds to seconds conversion requires dividing by 1_000.
Introduction 📟
Replaces
@testable import XMTPiOSwithimport XMTPiOSwhere possible; so tests are testing the public SDK API instead of internal fields/functionsPurpose ℹ️
Test the public API instead of internal fields/functions
Scope 🔭
Test cases