mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-19 13:55:21 +00:00
see if this fixes windows tests
This commit is contained in:
@@ -36,6 +36,7 @@
|
|||||||
"sander": "^0.6.0",
|
"sander": "^0.6.0",
|
||||||
"serialize-javascript": "^1.4.0",
|
"serialize-javascript": "^1.4.0",
|
||||||
"url-parse": "^1.2.0",
|
"url-parse": "^1.2.0",
|
||||||
|
"wait-port": "^0.2.2",
|
||||||
"walk-sync": "^0.3.2",
|
"walk-sync": "^0.3.2",
|
||||||
"webpack": "^3.10.0"
|
"webpack": "^3.10.0"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,18 +1,24 @@
|
|||||||
import * as net from 'net';
|
import waitPort from 'wait-port';
|
||||||
|
|
||||||
export function wait_for_port(port: number, cb: () => void) {
|
export function wait_for_port(port: number, cb: () => void) {
|
||||||
const socket = net.createConnection({ port }, () => {
|
waitPort({ port }).then(cb);
|
||||||
cb();
|
}
|
||||||
socket.destroy();
|
|
||||||
});
|
|
||||||
|
|
||||||
socket.on('error', err => {
|
// import * as net from 'net';
|
||||||
setTimeout(() => {
|
|
||||||
wait_for_port(port, cb);
|
|
||||||
}, 100);
|
|
||||||
});
|
|
||||||
|
|
||||||
setTimeout(() => {
|
// export function wait_for_port(port: number, cb: () => void) {
|
||||||
socket.destroy();
|
// const socket = net.createConnection(port, 'localhost', () => {
|
||||||
}, 100);
|
// cb();
|
||||||
}
|
// socket.destroy();
|
||||||
|
// });
|
||||||
|
|
||||||
|
// socket.on('error', err => {
|
||||||
|
// setTimeout(() => {
|
||||||
|
// wait_for_port(port, cb);
|
||||||
|
// }, 100);
|
||||||
|
// });
|
||||||
|
|
||||||
|
// setTimeout(() => {
|
||||||
|
// socket.destroy();
|
||||||
|
// }, 100);
|
||||||
|
// }
|
||||||
Reference in New Issue
Block a user