From 307a534baa374af6cb9b3d7e9e777b46c7489b73 Mon Sep 17 00:00:00 2001 From: Eric Theise Date: Mon, 1 Jan 2024 20:07:41 -0800 Subject: [PATCH] Run Prettier on code base. --- js/map.ts | 2 +- tests/test.autorepair.josm.ts | 51 +++++++++++--------------------- tests/test.autorepair.recurse.ts | 36 ++++++++-------------- 3 files changed, 30 insertions(+), 59 deletions(-) diff --git a/js/map.ts b/js/map.ts index d845abf0..a7c3d262 100644 --- a/js/map.ts +++ b/js/map.ts @@ -52,7 +52,7 @@ $(document).ready(() => { disable_poiomatic: false }; const ide = { - map: (undefined as unknown) as L.Map, + map: undefined as unknown as L.Map, mapcss: "", async getQuery(): Promise { let query = settings.code["overpass"]; diff --git a/tests/test.autorepair.josm.ts b/tests/test.autorepair.josm.ts index 6150c5fa..9a25aa24 100644 --- a/tests/test.autorepair.josm.ts +++ b/tests/test.autorepair.josm.ts @@ -11,21 +11,17 @@ describe("ide.autorepair.josm", () => { { // basic case inp: '', - outp: - '' + outp: '' }, { // preserve other osm-script parameters inp: '', - outp: - '' + outp: '' }, { // more complex real world example - inp: - '\n \n \n \n \n \n', - outp: - '\n \n \n \n \n \n' + inp: '\n \n \n \n \n \n', + outp: '\n \n \n \n \n \n' } ]; vi.spyOn(ide, "getQueryLang").mockImplementation(() => "xml"); @@ -57,10 +53,8 @@ describe("ide.autorepair.josm", () => { }, { // more complex real world example - inp: - '/*bla*/\n[out:json];\nway\n ["amenity"]\n ({{bbox}})\n->.foo;\n.foo out meta qt;', - outp: - '/*bla*/\n[out:xml];/*fixed by auto repair*/\nway\n ["amenity"]\n ({{bbox}})\n->.foo;\n.foo out meta qt;' + inp: '/*bla*/\n[out:json];\nway\n ["amenity"]\n ({{bbox}})\n->.foo;\n.foo out meta qt;', + outp: '/*bla*/\n[out:xml];/*fixed by auto repair*/\nway\n ["amenity"]\n ({{bbox}})\n->.foo;\n.foo out meta qt;' } ]; vi.spyOn(ide, "getQueryLang").mockImplementation(() => "OverpassQL"); @@ -83,15 +77,12 @@ describe("ide.autorepair.josm", () => { { // trivial case 2 inp: '', - outp: - '' + outp: '' }, { // more complex real world example - inp: - '\n \n \n \n \n \n', - outp: - '\n \n \n \n \n \n' + inp: '\n \n \n \n \n \n', + outp: '\n \n \n \n \n \n' } ]; vi.spyOn(ide, "getQueryLang").mockImplementation(() => "xml"); @@ -119,8 +110,7 @@ describe("ide.autorepair.josm", () => { { // non meta output mode inp: "out skel;out body;out ids;out tags;", - outp: - "out meta;/*fixed by auto repair*/out meta;/*fixed by auto repair*/out meta;/*fixed by auto repair*/out meta;/*fixed by auto repair*/" + outp: "out meta;/*fixed by auto repair*/out meta;/*fixed by auto repair*/out meta;/*fixed by auto repair*/out meta;/*fixed by auto repair*/" }, { // combined with other output options @@ -129,10 +119,8 @@ describe("ide.autorepair.josm", () => { }, { // more complex real world example - inp: - '/*bla*/\n[out:xml];\nway\n ["amenity"]\n ({{bbox}})\n->.foo;\n.foo out qt;', - outp: - '/*bla*/\n[out:xml];\nway\n ["amenity"]\n ({{bbox}})\n->.foo;\n.foo out meta qt;/*fixed by auto repair*/' + inp: '/*bla*/\n[out:xml];\nway\n ["amenity"]\n ({{bbox}})\n->.foo;\n.foo out qt;', + outp: '/*bla*/\n[out:xml];\nway\n ["amenity"]\n ({{bbox}})\n->.foo;\n.foo out meta qt;/*fixed by auto repair*/' } ]; vi.spyOn(ide, "getQueryLang").mockImplementation(() => "OverpassQL"); @@ -150,32 +138,27 @@ describe("ide.autorepair.josm", () => { { // center geometry inp: '', - outp: - '' + outp: '' }, { // bounds geometry inp: '', - outp: - '' + outp: '' }, { // full geometry inp: '', - outp: - '' + outp: '' }, { // full geometry with from output mode inp: '', - outp: - '' + outp: '' }, { // full geometry with named input set inp: '', - outp: - '' + outp: '' } ]; vi.spyOn(ide, "getQueryLang").mockImplementation(() => "xml"); diff --git a/tests/test.autorepair.recurse.ts b/tests/test.autorepair.recurse.ts index c8b5baa1..6e2c2453 100644 --- a/tests/test.autorepair.recurse.ts +++ b/tests/test.autorepair.recurse.ts @@ -11,22 +11,17 @@ describe("ide.autorepair.recurse", () => { { // trivial case inp: "", - outp: - '\n\n\n \n \n\n' + outp: '\n\n\n \n \n\n' }, { // simple real life example - inp: - '\n \n \n \n \n \n', - outp: - '\n \n \n \n \n \n \n \n \n \n \n \n' + inp: '\n \n \n \n \n \n', + outp: '\n \n \n \n \n \n \n \n \n \n \n \n' }, { // complex example with multiple prints and named input sets - inp: - '\n \n \n\n\n \n \n\n\n', - outp: - '\n \n \n\n\n \n \n\n\n\n \n \n\n\n\n\n\n \n \n\n\n' + inp: '\n \n \n\n\n \n \n\n\n', + outp: '\n \n \n\n\n \n \n\n\n\n \n \n\n\n\n\n\n \n \n\n\n' } ]; vi.spyOn(ide, "getQueryLang").mockImplementation(() => "xml"); @@ -48,30 +43,23 @@ describe("ide.autorepair.recurse", () => { }, { // simple real life example - inp: - '/*This is the drinking water example in OverpassQL.*/\n(\n way["name"]({{bbox}})\n);\nout;', - outp: - '/*This is the drinking water example in OverpassQL.*/\n(\n way["name"]({{bbox}})\n);\n/*added by auto repair*/\n(._;>;);\n/*end of auto repair*/\nout;' + inp: '/*This is the drinking water example in OverpassQL.*/\n(\n way["name"]({{bbox}})\n);\nout;', + outp: '/*This is the drinking water example in OverpassQL.*/\n(\n way["name"]({{bbox}})\n);\n/*added by auto repair*/\n(._;>;);\n/*end of auto repair*/\nout;' }, { // simple query with coordinates - inp: - '(way["name"](50.75267740365953,7.085511088371277,50.755728421888925,7.0877212285995475));out;', - outp: - '(way["name"](50.75267740365953,7.085511088371277,50.755728421888925,7.0877212285995475));/*added by auto repair*/(._;>;);/*end of auto repair*/out;' + inp: '(way["name"](50.75267740365953,7.085511088371277,50.755728421888925,7.0877212285995475));out;', + outp: '(way["name"](50.75267740365953,7.085511088371277,50.755728421888925,7.0877212285995475));/*added by auto repair*/(._;>;);/*end of auto repair*/out;' }, { // complex example with multiple prints and named input sets - inp: - 'way\n ["amenity"]\n ({{bbox}})\n->.foo;\nway\n ["building"]\n ({{bbox}})\n->.bar;\n.foo out;\n.bar out meta;', - outp: - 'way\n ["amenity"]\n ({{bbox}})\n->.foo;\nway\n ["building"]\n ({{bbox}})\n->.bar;\n/*added by auto repair*/\n(.foo;.foo >;)->.foo;\n/*end of auto repair*/\n.foo out;\n/*added by auto repair*/\n(.bar;.bar >;)->.bar;\n/*end of auto repair*/\n.bar out meta;' + inp: 'way\n ["amenity"]\n ({{bbox}})\n->.foo;\nway\n ["building"]\n ({{bbox}})\n->.bar;\n.foo out;\n.bar out meta;', + outp: 'way\n ["amenity"]\n ({{bbox}})\n->.foo;\nway\n ["building"]\n ({{bbox}})\n->.bar;\n/*added by auto repair*/\n(.foo;.foo >;)->.foo;\n/*end of auto repair*/\n.foo out;\n/*added by auto repair*/\n(.bar;.bar >;)->.bar;\n/*end of auto repair*/\n.bar out meta;' }, { // example with the term "...out..." in string parameters inp: 'way({{bbox}})[junction=roundabout][name!="out"];out;', - outp: - 'way({{bbox}})[junction=roundabout][name!="out"];/*added by auto repair*/(._;>;);/*end of auto repair*/out;' + outp: 'way({{bbox}})[junction=roundabout][name!="out"];/*added by auto repair*/(._;>;);/*end of auto repair*/out;' } ]; vi.spyOn(ide, "getQueryLang").mockImplementation(() => "OverpassQL");