Files
sdk/pkg/frontend_server_client/test/example/vm_client_test.dart
T
Jonas Finnemann Jensen 8ffc0dddd0 Format frontend_server_client
Change-Id: Ibfdf6a7afedaf9e1486624a85e7d04437db13e49
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494460
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Auto-Submit: Jonas Jensen <jonasfj@google.com>
2026-04-10 09:53:29 -07:00

44 lines
1.3 KiB
Dart

// Copyright 2022 The Dart Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// TODO: The examples don't work on windows
@TestOn('!windows')
library;
import 'dart:io';
import 'package:frontend_server_client/src/package_config_utils.dart';
import 'package:test/test.dart';
import 'package:test_process/test_process.dart';
void main() {
test('vm client example can build and rebuild an app', () async {
// Resolve the example script path based on the package root.
final exampleFilePath = await pathFromNearestPackageConfig(
'example/vm_client.dart',
);
final process = await TestProcess.start(Platform.resolvedExecutable, [
'run',
exampleFilePath,
]);
await expectLater(
process.stdout,
emitsThrough(contains('done compiling example/app/main.dart')),
);
await expectLater(
process.stdout,
emitsThrough(contains('APP -> hello/world')),
);
await expectLater(
process.stdout,
emitsThrough(contains('done recompiling example/app/main.dart')),
);
await expectLater(
process.stdout,
emitsThrough(contains('APP -> goodbye/world')),
);
expect(await process.exitCode, 0);
});
}