OLD | NEW |
(Empty) | |
| 1 library pub_tests; |
| 2 import 'package:scheduled_test/scheduled_test.dart'; |
| 3 import '../../descriptor.dart' as d; |
| 4 import '../../test_pub.dart'; |
| 5 import '../utils.dart'; |
| 6 main() { |
| 7 initConfig(); |
| 8 integration("binds a directory to a new port", () { |
| 9 d.dir( |
| 10 appPath, |
| 11 [ |
| 12 d.appPubspec(), |
| 13 d.dir("test", [d.file("index.html", "<test body>")]), |
| 14 d.dir("web", [d.file("index.html", "<body>")])]).create(); |
| 15 pubServe(args: ["web"]); |
| 16 expectWebSocketResult("serveDirectory", { |
| 17 "path": "test" |
| 18 }, { |
| 19 "url": matches(r"http://localhost:\d+") |
| 20 }).then((response) { |
| 21 var url = Uri.parse(response["url"]); |
| 22 registerServerPort("test", url.port); |
| 23 }); |
| 24 requestShouldSucceed("index.html", "<test body>", root: "test"); |
| 25 d.dir(appPath, [d.dir("test", [d.file("index.html", "after")])]).create(); |
| 26 waitForBuildSuccess(); |
| 27 requestShouldSucceed("index.html", "after", root: "test"); |
| 28 endPubServe(); |
| 29 }); |
| 30 } |
OLD | NEW |