Fix tests

This commit is contained in:
pietervdvn 2021-07-03 21:39:30 +02:00
parent 040cd5a3b8
commit 2f05010648
2 changed files with 11 additions and 3 deletions

View file

@ -1,5 +1,6 @@
import {lstatSync, readdirSync, readFileSync} from "fs";
import {Utils} from "../Utils";
Utils.runningFromConsole = true
import * as https from "https";
import {LayerConfigJson} from "../Customizations/JSON/LayerConfigJson";
@ -52,8 +53,15 @@ export default class ScriptUtils {
return new Promise((resolve, reject) => {
try {
https.get(url, (res) => {
const urlObj = new URL(url)
https.get({
host: urlObj.host,
path: urlObj.pathname,
port: urlObj.port,
headers: {
"accept": "application/json"
}
}, (res) => {
const parts: string[] = []
res.setEncoding('utf8');
res.on('data', function (chunk) {

View file

@ -9,7 +9,7 @@ export default class OsmObjectSpec extends T {
"Download referencing ways",
() => {
let downloaded = false;
OsmObject.DownloadReferencingWays("node/1124134958", ways => {
OsmObject.DownloadReferencingWays("node/1124134958").addCallbackAndRunD(ways => {
downloaded = true;
console.log(ways)
})