run_test.dart 769 Bytes
Newer Older
1 2 3 4
// Copyright 2016 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 7
import 'package:flutter_tools/src/commands/run.dart';

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

12
void main() {
13
  group('run', () {
14
    testUsingContext('fails when target not found', () async {
15
      final RunCommand command = new RunCommand();
16
      applyMocksToCommand(command);
17 18 19 20 21 22
      try {
        await createTestCommandRunner(command).run(<String>['run', '-t', 'abc123']);
        fail('Expect exception');
      } on ToolExit catch (e) {
        expect(e.exitCode ?? 1, 1);
      }
23 24 25
    });
  });
}