Fix tests
This commit is contained in:
parent
040cd5a3b8
commit
2f05010648
2 changed files with 11 additions and 3 deletions
|
@ -1,5 +1,6 @@
|
||||||
import {lstatSync, readdirSync, readFileSync} from "fs";
|
import {lstatSync, readdirSync, readFileSync} from "fs";
|
||||||
import {Utils} from "../Utils";
|
import {Utils} from "../Utils";
|
||||||
|
|
||||||
Utils.runningFromConsole = true
|
Utils.runningFromConsole = true
|
||||||
import * as https from "https";
|
import * as https from "https";
|
||||||
import {LayerConfigJson} from "../Customizations/JSON/LayerConfigJson";
|
import {LayerConfigJson} from "../Customizations/JSON/LayerConfigJson";
|
||||||
|
@ -52,8 +53,15 @@ export default class ScriptUtils {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
const urlObj = new URL(url)
|
||||||
https.get(url, (res) => {
|
https.get({
|
||||||
|
host: urlObj.host,
|
||||||
|
path: urlObj.pathname,
|
||||||
|
port: urlObj.port,
|
||||||
|
headers: {
|
||||||
|
"accept": "application/json"
|
||||||
|
}
|
||||||
|
}, (res) => {
|
||||||
const parts: string[] = []
|
const parts: string[] = []
|
||||||
res.setEncoding('utf8');
|
res.setEncoding('utf8');
|
||||||
res.on('data', function (chunk) {
|
res.on('data', function (chunk) {
|
||||||
|
|
|
@ -9,7 +9,7 @@ export default class OsmObjectSpec extends T {
|
||||||
"Download referencing ways",
|
"Download referencing ways",
|
||||||
() => {
|
() => {
|
||||||
let downloaded = false;
|
let downloaded = false;
|
||||||
OsmObject.DownloadReferencingWays("node/1124134958", ways => {
|
OsmObject.DownloadReferencingWays("node/1124134958").addCallbackAndRunD(ways => {
|
||||||
downloaded = true;
|
downloaded = true;
|
||||||
console.log(ways)
|
console.log(ways)
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue