Skip to content

Commit 4d59f6f

Browse files
gburnetttmcw
authored andcommitted
fix: Serve on correct port
Update serve command to pass object to get-port
1 parent fb37789 commit 4d59f6f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

__tests__/bin-watch-serve.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ test(
6363
return pEvent(docProcess.stdout, 'data').then(function(data) {
6464
const portNumber = data
6565
.toString()
66-
.match(/documentation.js serving on port (\d+)/);
66+
.match(/documentation.js serving on port 4004/);
6767
expect(portNumber).toBeTruthy();
68-
return get(`http://localhost:${portNumber[1]}/`).then(function(text) {
68+
return get(`http://localhost:4004/`).then(function(text) {
6969
expect(text.match(/<html>/)).toBeTruthy();
7070
docProcess.kill();
7171
});

src/commands/serve.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ module.exports.handler = function serve(argv: Object) {
5454
}
5555
}
5656

57-
getPort(argv.port).then(port => {
57+
getPort({ port: argv.port }).then(port => {
5858
const server = new Server(port);
5959
let watcher;
6060

0 commit comments

Comments
 (0)