-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Override dependencies of locked packages
Partially addresses #1853
- Loading branch information
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS d.file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE d.file. | ||
|
||
import 'package:test/test.dart'; | ||
|
||
import '../descriptor.dart' as d; | ||
import '../test_pub.dart'; | ||
|
||
main() { | ||
// Regression test for #1853 | ||
test("overrides a locked package's dependency", () async { | ||
await servePackages((builder) { | ||
builder.serve("foo", "1.2.3", deps: {"bar": "1.2.3"}); | ||
builder.serve("bar", "1.2.3"); | ||
}); | ||
|
||
await d.dir('bar', | ||
[d.libDir('bar', 'bar 0.0.1'), d.libPubspec('bar', '0.0.1')]).create(); | ||
|
||
await d.appDir({ | ||
"foo": "any" | ||
}).create(); | ||
|
||
await pubGet(); | ||
|
||
await d.dir(appPath, [ | ||
d.pubspec({ | ||
"name": "myapp", | ||
"dependencies": { | ||
"foo": "any" | ||
}, | ||
"dependency_overrides": {"bar": {"path": "../bar"}} | ||
}) | ||
]).create(); | ||
|
||
await pubGet(); | ||
|
||
await d.appPackagesFile({"foo": "1.2.3", "bar": "../bar"}).validate(); | ||
}); | ||
} |