Skip to content

Commit

Permalink
Test behavior if a file exists in the target directory
Browse files Browse the repository at this point in the history
  • Loading branch information
kevmoo committed Apr 11, 2018
1 parent d5cecf0 commit bd27ca0
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions webdev/test/e2e_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,26 @@ void main() {
await d.file('pubspec.lock', isNotEmpty).validate(exampleDirectory);
});

test('build should fail if targetting an existing directory', () async {
await d.file('simple thing', 'throw-away').create();

var args = ['build', '-o', 'web:${d.sandbox}'];

var process = await runWebDev(args, workingDirectory: exampleDirectory);

// NOTE: We'd like this to be more useful
// See https://github.com/dart-lang/build/issues/1283

await expectLater(
process.stdout,
emitsThrough(
'[WARNING] Skipped creation of the merged output directory.'));
await expectLater(process.stderr,
emitsThrough('Failed to create merged output directories.'));

await process.shouldExit(1);
});

group('should build with valid configuration', () {
for (var withDDC in [true, false]) {
test(withDDC ? 'DDC' : 'dart2js', () async {
Expand Down

0 comments on commit bd27ca0

Please sign in to comment.