Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/modernize'
- Loading branch information
Showing
10 changed files
with
112 additions
and
357 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: check | ||
on: [push] | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@main | ||
- uses: actions/setup-node@main | ||
with: | ||
node-version: 'lts/*' | ||
- run: yarn install | ||
- run: make check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
check: lint test | ||
|
||
lint: | ||
./node_modules/.bin/jshint *.js lib test | ||
./node_modules/.bin/jshint *.js test | ||
|
||
test: | ||
./node_modules/.bin/mocha --recursive --require should | ||
node --test | ||
|
||
.PHONY: check lint test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,31 @@ | ||
var should = require('should'); | ||
var dumpTile = require('../'); | ||
const test = require('node:test'); | ||
const assert = require('node:assert/strict'); | ||
|
||
describe('dump-tile node module', function () { | ||
it('must have at least one test', function () { | ||
dumpTile(); | ||
should.fail('Need to write tests.'); | ||
const { createReadStream } = require('node:fs'); | ||
const { PassThrough } = require('node:stream'); | ||
const { buffer } = require('node:stream/consumers'); | ||
|
||
const dumpTile = require('../'); | ||
|
||
test('dump tile', async function (t) { | ||
|
||
await t.test('empty tile', async function () { | ||
const o = await parseToObject('test/fixtures/empty.pbf'); | ||
assert.deepEqual(o, { layers: [] }); | ||
}); | ||
|
||
await t.test('simple tile', async function () { | ||
const o = await parseToObject('test/fixtures/data.pbf'); | ||
assert(Array.isArray(o.layers)); | ||
assert.equal(o.layers.length, 16); | ||
}); | ||
|
||
}); | ||
|
||
async function parseToObject(filename) { | ||
const from = createReadStream(filename); | ||
const to = new PassThrough(); | ||
await dumpTile(from, to); | ||
to.end(); | ||
return JSON.parse((await buffer(to))); | ||
} |
Binary file not shown.
Binary file not shown.
Oops, something went wrong.