Skip to content

Commit bdf6855

Browse files
committed
Fixed test issue.
Fixed dartfmt issues.
1 parent 3afa990 commit bdf6855

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

lib/sentry.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,9 @@ class SentryClient {
159159

160160
/// Reports an [event] to Sentry.io.
161161
Future<SentryResponse> capture({@required Event event}) async {
162-
163162
final DateTime now = _clock();
164163
String authHeader = 'Sentry sentry_version=6, sentry_client=$sentryClient, '
165-
'sentry_timestamp=${now.millisecondsSinceEpoch}, sentry_key=$publicKey';
164+
'sentry_timestamp=${now.millisecondsSinceEpoch}, sentry_key=$publicKey';
166165
if (secretKey != null) {
167166
authHeader += ', sentry_secret=$secretKey';
168167
}

test/sentry_test.dart

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ void main() {
2525

2626
testCaptureException(bool compressPayload) async {
2727
final MockClient httpMock = new MockClient();
28-
final ClockProvider fakeClockProvider = () => new DateTime.utc(2017, 1, 2);
28+
final ClockProvider fakeClockProvider =
29+
() => new DateTime.utc(2017, 1, 2);
2930

3031
String postUri;
3132
Map<String, String> headers;
@@ -130,7 +131,7 @@ void main() {
130131

131132
test('reads error message from the x-sentry-error header', () async {
132133
final MockClient httpMock = new MockClient();
133-
final Clock fakeClock = new Clock.fixed(new DateTime(2017, 1, 2));
134+
final ClockProvider fakeClockProvider = () => DateTime(2017, 1, 2);
134135

135136
httpMock.answerWith((Invocation invocation) async {
136137
if (invocation.memberName == #close) {
@@ -147,7 +148,7 @@ void main() {
147148
final SentryClient client = new SentryClient(
148149
dsn: _testDsn,
149150
httpClient: httpMock,
150-
clock: fakeClock,
151+
clock: fakeClockProvider,
151152
uuidGenerator: () => 'X' * 32,
152153
compressPayload: false,
153154
environmentAttributes: const Event(
@@ -173,7 +174,7 @@ void main() {
173174

174175
test('$Event userContext overrides client', () async {
175176
final MockClient httpMock = new MockClient();
176-
final Clock fakeClock = new Clock.fixed(new DateTime(2017, 1, 2));
177+
final ClockProvider fakeClockProvider = () => DateTime(2017, 1, 2);
177178

178179
String loggedUserId; // used to find out what user context was sent
179180
httpMock.answerWith((Invocation invocation) async {
@@ -208,7 +209,7 @@ void main() {
208209
final SentryClient client = new SentryClient(
209210
dsn: _testDsn,
210211
httpClient: httpMock,
211-
clock: fakeClock,
212+
clock: fakeClockProvider,
212213
uuidGenerator: () => 'X' * 32,
213214
compressPayload: false,
214215
environmentAttributes: const Event(

0 commit comments

Comments
 (0)