logs_test.dart 776 Bytes
Newer Older
Ian Hickson's avatar
Ian Hickson committed
1
// Copyright 2014 The Flutter Authors. All rights reserved.
2 3 4
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

5
import 'package:flutter_tools/src/base/common.dart';
6
import 'package:flutter_tools/src/commands/logs.dart';
7

8 9 10
import '../../src/common.dart';
import '../../src/context.dart';
import '../../src/mocks.dart';
11

12
void main() {
13
  group('logs', () {
14
    testUsingContext('fail with a bad device id', () async {
15
      final LogsCommand command = LogsCommand();
16
      applyMocksToCommand(command);
17 18 19 20 21 22
      try {
        await createTestCommandRunner(command).run(<String>['-d', 'abc123', 'logs']);
        fail('Expect exception');
      } on ToolExit catch (e) {
        expect(e.exitCode ?? 1, 1);
      }
23 24 25
    });
  });
}