logs_test.dart 805 Bytes
Newer Older
1 2 3 4
// Copyright 2015 The Chromium Authors. All rights reserved.
// 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
import 'package:test/test.dart';

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

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