mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-12 03:05:12 +00:00
see if this fixes windows tests
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
"sander": "^0.6.0",
|
||||
"serialize-javascript": "^1.4.0",
|
||||
"url-parse": "^1.2.0",
|
||||
"wait-port": "^0.2.2",
|
||||
"walk-sync": "^0.3.2",
|
||||
"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) {
|
||||
const socket = net.createConnection({ port }, () => {
|
||||
cb();
|
||||
socket.destroy();
|
||||
});
|
||||
waitPort({ port }).then(cb);
|
||||
}
|
||||
|
||||
socket.on('error', err => {
|
||||
setTimeout(() => {
|
||||
wait_for_port(port, cb);
|
||||
}, 100);
|
||||
});
|
||||
// import * as net from 'net';
|
||||
|
||||
setTimeout(() => {
|
||||
socket.destroy();
|
||||
}, 100);
|
||||
}
|
||||
// export function wait_for_port(port: number, cb: () => void) {
|
||||
// const socket = net.createConnection(port, 'localhost', () => {
|
||||
// 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