Tiny fix about outdated message (#114391)
This commit is contained in:
@@ -106,4 +106,24 @@ void main() {
|
||||
message: 'File was not created, ensure path is valid'));
|
||||
});
|
||||
});
|
||||
|
||||
group('Screenshot output validation', () {
|
||||
testWithoutContext('successful', () async {
|
||||
final MemoryFileSystem fs = MemoryFileSystem.test();
|
||||
fs.file('test.png').createSync();
|
||||
|
||||
expect(() => ScreenshotCommand.ensureOutputIsNotJsonRpcError(fs.file('test.png')),
|
||||
returnsNormally);
|
||||
});
|
||||
|
||||
testWithoutContext('failed', () async {
|
||||
final MemoryFileSystem fs = MemoryFileSystem.test();
|
||||
fs.file('test.png').writeAsStringSync('{"jsonrpc":"2.0", "error":"something"}');
|
||||
|
||||
expect(
|
||||
() => ScreenshotCommand.ensureOutputIsNotJsonRpcError(fs.file('test.png')),
|
||||
throwsToolExit(
|
||||
message: 'It appears the output file contains an error message, not valid output.'));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user