blob: c29ef2726c4f45457e6fc10e93b7d8d552e6f30e [file] [log] [blame]
Ian Hickson449f4a62019-11-27 15:04:02 -08001// Copyright 2014 The Flutter Authors. All rights reserved.
Ian Fischer6a5fe192015-09-29 14:26:42 -07002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Dan Rubele384c0d2016-11-13 22:09:03 -05005import 'package:flutter_tools/src/base/common.dart';
Adam Barthda0a12c2015-11-10 13:18:34 -08006import 'package:flutter_tools/src/commands/logs.dart';
Ian Fischer6a5fe192015-09-29 14:26:42 -07007
Ian Hicksond919e692019-07-13 11:51:44 -07008import '../../src/common.dart';
9import '../../src/context.dart';
10import '../../src/mocks.dart';
Ian Fischer6a5fe192015-09-29 14:26:42 -070011
Hixiec7339de2016-03-09 17:43:14 -080012void main() {
Ian Fischer6a5fe192015-09-29 14:26:42 -070013 group('logs', () {
Dan Rubele384c0d2016-11-13 22:09:03 -050014 testUsingContext('fail with a bad device id', () async {
Alexandre Ardhuind927c932018-09-12 08:29:29 +020015 final LogsCommand command = LogsCommand();
Adam Barthbdd20662015-10-11 19:42:50 -070016 applyMocksToCommand(command);
Dan Rubele384c0d2016-11-13 22:09:03 -050017 try {
18 await createTestCommandRunner(command).run(<String>['-d', 'abc123', 'logs']);
19 fail('Expect exception');
20 } on ToolExit catch (e) {
21 expect(e.exitCode ?? 1, 1);
22 }
Ian Fischer6a5fe192015-09-29 14:26:42 -070023 });
24 });
25}