I'm attempting to contribute a module to turf, following the contribution guide included in the repository.
I'm running into issues when trying to run "npm test" from the root of turf. Any guidance is greatly appreciated.
lerna ERR! test Errored while running script in '@turf/voronoi'
lerna ERR! execute callback with error
lerna ERR! Error: Command failed: yarn run test
lerna ERR!
lerna ERR! index.js ā main.js, main.es.js...
lerna ERR! (!) Unresolved dependencies
lerna ERR! https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency
lerna ERR! @turf/helpers (imported by index.js)
lerna ERR! @turf/invariant (imported by index.js)
lerna ERR! d3-voronoi (imported by index.js)
lerna ERR! created main.js, main.es.js in 16ms
lerna ERR! error Command failed with exit code 1.
lerna ERR! yarn run v1.3.2
lerna ERR! $ rollup -c ../../rollup.config.js
lerna ERR! $ node -r @std/esm test.js
lerna ERR! TAP version 13
lerna ERR! # turf-voronoi
lerna ERR! not ok 1 ninepoints
lerna ERR! ---
lerna ERR! operator: deepEqual
lerna ERR! expected: |-
lerna ERR! { type: 'FeatureCollection', bbox: [ 143, -38, 146, -35 ], features: [ { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [ 144.33837890625, -37.14280344371683 ] } }, { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [ 144.931640625, -37.35269280367274 ] } }, { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [ 145.140380859375, -36.456636011596196 ] } }, { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [ 145.469970703125, -36.77409249464194 ] } }, { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [ 145.755615234375, -37.090239803072066 ] } }, { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [ 145.4150390625, -37.52715361723378 ] } }, { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [ 145.887451171875, -37.483576550426996 ] } }, { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [ 144.60205078125, -36.57142382346275 ] } }, { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [ 144.86572265625, -37.596824001083654 ] } } ] }
lerna ERR! actual: |-
lerna ERR! { type: 'FeatureCollection', features: [ { type: 'Feature', properties: {}, geometry: { type: 'Polygon', coordinates: [ [Object] ] } }, { type: 'Feature', properties: {}, geometry: { type: 'Polygon', coordinates: [ [Object] ] } }, { type: 'Feature', properties: {}, geometry: { type: 'Polygon', coordinates: [ [Object] ] } }, { type: 'Feature', properties: {}, geometry: { type: 'Polygon', coordinates: [ [Object] ] } }, { type: 'Feature', properties: {}, geometry: { type: 'Polygon', coordinates: [ [Object] ] } }, { type: 'Feature', properties: {}, geometry: { type: 'Polygon', coordinates: [ [Object] ] } }, { type: 'Feature', properties: {}, geometry: { type: 'Polygon', coordinates: [ [Object] ] } }, { type: 'Feature', properties: {}, geometry: { type: 'Polygon', coordinates: [ [Object] ] } }, { type: 'Feature', properties: {}, geometry: { type: 'Polygon', coordinates: [ [Object] ] } } ] }
lerna ERR! at: glob.sync.forEach.filepath (C:\Users\Adam\source\repos\turf\packages\turf-voronoi\test.js:17:11)
lerna ERR! stack: |-
lerna ERR! Error: ninepoints
lerna ERR! at Test.assert [as _assert] (C:\Users\Adam\source\repos\turf\node_modules\tape\lib\test.js:212:54)
lerna ERR! at Test.bound [as _assert] (C:\Users\Adam\source\repos\turf\node_modules\tape\lib\test.js:64:32)
lerna ERR! at Test._cd9ā.r.Test.deepEqual.Test.deepEquals.Test.isEquivalent.Test.same (C:\Users\Adam\source\repos\turf\node_modules\tape\lib\test.js:380:10)
lerna ERR! at Test.bound [as deepEqual] (C:\Users\Adam\source\repos\turf\node_modules\tape\lib\test.js:64:32)
lerna ERR! at glob.sync.forEach.filepath (C:\Users\Adam\source\repos\turf\packages\turf-voronoi\test.js:17:11)
lerna ERR! at Array.forEach ()
lerna ERR! at Test._b3dā.r.t (C:\Users\Adam\source\repos\turf\packages\turf-voronoi\test.js:10:61)
lerna ERR! at Test.bound [as _cb] (C:\Users\Adam\source\repos\turf\node_modules\tape\lib\test.js:64:32)
lerna ERR! at Test._cd9ā.r.Test.run (C:\Users\Adam\source\repos\turf\node_modules\tape\lib\test.js:83:10)
lerna ERR! at Test.bound [as run] (C:\Users\Adam\source\repos\turf\node_modules\tape\lib\test.js:64:32)
lerna ERR! ...
lerna ERR! not ok 2 simple
lerna ERR! ---
lerna ERR! operator: deepEqual
lerna ERR! expected: |-
lerna ERR! { type: 'FeatureCollection', bbox: [ 140, -40, 160, -30 ], features: [ { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [ 145, -37 ] } } ] }
lerna ERR! actual: |-
lerna ERR! { type: 'FeatureCollection', features: [ { type: 'Feature', properties: {}, geometry: { type: 'Polygon', coordinates: [ [Object] ] } } ] }
lerna ERR! at: glob.sync.forEach.filepath (C:\Users\Adam\source\repos\turf\packages\turf-voronoi\test.js:17:11)
lerna ERR! stack: |-
lerna ERR! Error: simple
lerna ERR! at Test.assert [as _assert] (C:\Users\Adam\source\repos\turf\node_modules\tape\lib\test.js:212:54)
lerna ERR! at Test.bound [as _assert] (C:\Users\Adam\source\repos\turf\node_modules\tape\lib\test.js:64:32)
lerna ERR! at Test._cd9ā.r.Test.deepEqual.Test.deepEquals.Test.isEquivalent.Test.same (C:\Users\Adam\source\repos\turf\node_modules\tape\lib\test.js:380:10)
lerna ERR! at Test.bound [as deepEqual] (C:\Users\Adam\source\repos\turf\node_modules\tape\lib\test.js:64:32)
lerna ERR! at glob.sync.forEach.filepath (C:\Users\Adam\source\repos\turf\packages\turf-voronoi\test.js:17:11)
lerna ERR! at Array.forEach ()
lerna ERR! at Test._b3dā.r.t (C:\Users\Adam\source\repos\turf\packages\turf-voronoi\test.js:10:61)
lerna ERR! at Test.bound [as _cb] (C:\Users\Adam\source\repos\turf\node_modules\tape\lib\test.js:64:32)
lerna ERR! at Test._cd9ā.r.Test.run (C:\Users\Adam\source\repos\turf\node_modules\tape\lib\test.js:83:10)
lerna ERR! at Test.bound [as run] (C:\Users\Adam\source\repos\turf\node_modules\tape\lib\test.js:64:32)
lerna ERR! ...
lerna ERR! not ok 3 world
lerna ERR! ---
lerna ERR! operator: deepEqual
lerna ERR! expected: |-
lerna ERR! { type: 'FeatureCollection', features: [ { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [ -77.6953125, 59.5343180010956 ] } }, { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [ -78.75, 41.244772343082076 ] } }, { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [ -1.7578125, 65.80277639340238 ] } }, { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [ 31.289062500000004, 32.84267363195431 ] } }, { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [ 72.0703125, 60.06484046010452 ] } }, { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [ -29.8828125, 1.0546279422758869 ] } }, { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [ 81.9140625, 12.554563528593656 ] } }, { type: 'Feature', properties: {}, geometry: { type: 'Point', coordinates: [ 50.625, -4.214943141390639 ] } } ] }
lerna ERR! actual: |-
lerna ERR! { type: 'FeatureCollection', features: [ { type: 'Feature', properties: {}, geometry: { type: 'Polygon', coordinates: [ [Object] ] } }, { type: 'Feature', properties: {}, geometry: { type: 'Polygon', coordinates: [ [Object] ] } }, { type: 'Feature', properties: {}, geometry: { type: 'Polygon', coordinates: [ [Object] ] } }, { type: 'Feature', properties: {}, geometry: { type: 'Polygon', coordinates: [ [Object] ] } }, { type: 'Feature', properties: {}, geometry: { type: 'Polygon', coordinates: [ [Object] ] } }, { type: 'Feature', properties: {}, geometry: { type: 'Polygon', coordinates: [ [Object] ] } }, { type: 'Feature', properties: {}, geometry: { type: 'Polygon', coordinates: [ [Object] ] } }, { type: 'Feature', properties: {}, geometry: { type: 'Polygon', coordinates: [ [Object] ] } } ] }
lerna ERR! at: glob.sync.forEach.filepath (C:\Users\Adam\source\repos\turf\packages\turf-voronoi\test.js:17:11)
lerna ERR! stack: |-
lerna ERR! Error: world
lerna ERR! at Test.assert [as _assert] (C:\Users\Adam\source\repos\turf\node_modules\tape\lib\test.js:212:54)
lerna ERR! at Test.bound [as _assert] (C:\Users\Adam\source\repos\turf\node_modules\tape\lib\test.js:64:32)
lerna ERR! at Test._cd9ā.r.Test.deepEqual.Test.deepEquals.Test.isEquivalent.Test.same (C:\Users\Adam\source\repos\turf\node_modules\tape\lib\test.js:380:10)
lerna ERR! at Test.bound [as deepEqual] (C:\Users\Adam\source\repos\turf\node_modules\tape\lib\test.js:64:32)
lerna ERR! at glob.sync.forEach.filepath (C:\Users\Adam\source\repos\turf\packages\turf-voronoi\test.js:17:11)
lerna ERR! at Array.forEach ()
lerna ERR! at Test._b3dā.r.t (C:\Users\Adam\source\repos\turf\packages\turf-voronoi\test.js:10:61)
lerna ERR! at Test.bound [as _cb] (C:\Users\Adam\source\repos\turf\node_modules\tape\lib\test.js:64:32)
lerna ERR! at Test._cd9ā.r.Test.run (C:\Users\Adam\source\repos\turf\node_modules\tape\lib\test.js:83:10)
lerna ERR! at Test.bound [as run] (C:\Users\Adam\source\repos\turf\node_modules\tape\lib\test.js:64:32)
lerna ERR! ...
lerna ERR!
lerna ERR! 1..3
lerna ERR! # tests 3
lerna ERR! # pass 0
lerna ERR! # fail 3
lerna ERR!
lerna ERR! info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
lerna ERR!
lerna ERR! at Promise.all.then.arr (C:\Users\Adam\Source\Repos\turf\node_modules\execa\index.js:236:11)
lerna ERR! at
lerna WARN complete Waiting for 2 child processes to exit. CTRL-C to exit immediately.
yarn run v1.3.2
Gday @adam3039
Unfortunately the instructions there are a bit out of date. What you should be doing is from within your turf-rectangle-grid folder running npm run test, don't worry about running the tests for the whole of turf.
Hope that helps
Thank you @rowanwins
Glad it wasn't something I was doing!
All good - unfortunantly the contributing.md needs a bit of love.
Also a heads up that it looks like your index.js hasn't been committed to your repo because it's being ignored, I think this is a result of some work @DenisCarriere is donig on converting things to Typescript, @DenisCarriere any chance we can undo this change given that your work is kind of going slowly?
chance we can undo this change given that your work is kind of going slowly?
Yea we can undo this for now and add .gitignores to the Typescript converted repos. š
unfortunantly the contributing.md needs a bit of love.
There's some irony there somewhere. Thanks for pointing that out. I'll watch for that change.
Most helpful comment
Gday @adam3039
Unfortunately the instructions there are a bit out of date. What you should be doing is from within your
turf-rectangle-gridfolder runningnpm run test, don't worry about running the tests for the whole of turf.Hope that helps