dart format
This commit is contained in:
@@ -22,18 +22,27 @@ void main() {
|
||||
});
|
||||
|
||||
test('SocketException maps to NetworkException message', () {
|
||||
expect(errorToUserMessage(const SocketException('boom')),
|
||||
const NetworkException().userMessage);
|
||||
expect(
|
||||
errorToUserMessage(const SocketException('boom')),
|
||||
const NetworkException().userMessage,
|
||||
);
|
||||
});
|
||||
|
||||
test('TimeoutException maps to the timeout-specific NetworkException message', () {
|
||||
expect(errorToUserMessage(TimeoutException('slow')),
|
||||
NetworkException.timeout().userMessage);
|
||||
});
|
||||
test(
|
||||
'TimeoutException maps to the timeout-specific NetworkException message',
|
||||
() {
|
||||
expect(
|
||||
errorToUserMessage(TimeoutException('slow')),
|
||||
NetworkException.timeout().userMessage,
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
test('http.ClientException maps to NetworkException message', () {
|
||||
expect(errorToUserMessage(http.ClientException('failed')),
|
||||
const NetworkException().userMessage);
|
||||
expect(
|
||||
errorToUserMessage(http.ClientException('failed')),
|
||||
const NetworkException().userMessage,
|
||||
);
|
||||
});
|
||||
|
||||
test('HandshakeException maps to a TLS-specific message', () {
|
||||
@@ -43,8 +52,10 @@ void main() {
|
||||
});
|
||||
|
||||
test('FormatException maps to ParseException message', () {
|
||||
expect(errorToUserMessage(const FormatException('bad json')),
|
||||
const ParseException().userMessage);
|
||||
expect(
|
||||
errorToUserMessage(const FormatException('bad json')),
|
||||
const ParseException().userMessage,
|
||||
);
|
||||
});
|
||||
|
||||
test('ApiError surfaces only the first line of its message', () {
|
||||
@@ -58,8 +69,10 @@ void main() {
|
||||
});
|
||||
|
||||
test('unknown error type falls back', () {
|
||||
expect(errorToUserMessage(StateError('weird')),
|
||||
contains('Etwas ist schiefgelaufen'));
|
||||
expect(
|
||||
errorToUserMessage(StateError('weird')),
|
||||
contains('Etwas ist schiefgelaufen'),
|
||||
);
|
||||
});
|
||||
|
||||
test('custom fallback overrides the default', () {
|
||||
|
||||
Reference in New Issue
Block a user