pelias / wof-admin-lookup

Who's on First Admin Lookup for the Pelias Geocoder
https://pelias.io
MIT License
9 stars 24 forks source link

Unit tests fail if `sqlite: true` is set in `pelias.json` #262

Closed orangejulius closed 5 years ago

orangejulius commented 5 years ago

When sqlite: true is set in pelias.json, the unit tests for this repository will fail.

There is no clear error printed with the tap output, but running the tests directly shows that the tests are looking for a SQLite file that isn't there:

# PiP tests
# empty array should be returned when search_layers is empty even if lat/lon is in a polygon
unable to locate sqlite file /tmp/tmp_wof_data2019428-27169-1jx7xyd.four/sqlite/whosonfirst-data-latest.db
/home/julian/repos/pelias/wof-admin-lookup/test/pip/index.js:58
        o.lookup(0.5, 0.5, [], (err, results) => {
          ^

TypeError: Cannot read property 'lookup' of undefined
    at pip.create (/home/julian/repos/pelias/wof-admin-lookup/test/pip/index.js:58:11)
    at Object.createPIPService [as create] (/home/julian/repos/pelias/wof-admin-lookup/src/pip/index.js:51:14)
    at temp.mkdir (/home/julian/repos/pelias/wof-admin-lookup/test/pip/index.js:55:27)
    at /home/julian/repos/pelias/wof-admin-lookup/node_modules/temp/lib/temp.js:231:7
    at FSReqWrap.oncomplete (fs.js:135:15)