-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
201 additions
and
113 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 |
---|---|---|
@@ -1,8 +1,9 @@ | ||
import main from './processes/99_create_stats.js'; | ||
|
||
main().then(() => { | ||
process.exit(0); | ||
}).catch((e) => { | ||
console.error(e); | ||
process.exit(1); | ||
}); | ||
main(process.argv) | ||
.then(() => { | ||
process.exit(0); | ||
}).catch((e) => { | ||
console.error(e); | ||
process.exit(1); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import assert from 'node:assert'; | ||
import test from 'node:test'; | ||
|
||
import fs from 'node:fs/promises'; | ||
import main from './02_make_machi_aza.js'; | ||
import { MachiAzaApi } from '../data.js'; | ||
|
||
test.describe('with filter for 452092 (宮崎県えびの市)', async () => { | ||
test.before(async () => { | ||
process.env.SETTINGS_JSON = JSON.stringify({ lgCodes: ['452092'] }); | ||
}); | ||
|
||
test.after(async () => { | ||
delete process.env.SETTINGS_JSON; | ||
}); | ||
|
||
test('it generates the API', async () => { | ||
await fs.rm('./out/api_miyazaki_ebino', { recursive: true, force: true }); | ||
await main(['', '', './out/api_miyazaki_ebino']); | ||
assert.ok(true); | ||
|
||
const e = JSON.parse(await fs.readFile('./out/api_miyazaki_ebino/ja/宮崎県/えびの市.json', 'utf-8')) as MachiAzaApi; | ||
const eData = e.data; | ||
assert(eData.length > 100); | ||
assert(eData.find((city) => city.machiaza_id === '0000110')?.koaza === '下村'); | ||
}); | ||
}); | ||
|
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import assert from 'node:assert'; | ||
import test from 'node:test'; | ||
|
||
import fs from 'node:fs/promises'; | ||
import main from './03_make_rsdt.js'; | ||
import { getRangesFromCSV } from './10_refresh_csv_ranges.js'; | ||
|
||
test.describe('with filter for 131059 (東京都文京区)', async () => { | ||
test.before(async () => { | ||
process.env.SETTINGS_JSON = JSON.stringify({ lgCodes: ['131059'] }); | ||
}); | ||
|
||
test.after(async () => { | ||
delete process.env.SETTINGS_JSON; | ||
}); | ||
|
||
test('it generates the API', async () => { | ||
await fs.rm('./out/api_tokyo_bunkyo', { recursive: true, force: true }); | ||
await main(['', '', './out/api_tokyo_bunkyo']); | ||
assert.ok(true); | ||
|
||
const headers = await getRangesFromCSV('./out/api_tokyo_bunkyo/ja/東京都/文京区-住居表示.txt'); | ||
assert(typeof headers !== 'undefined'); | ||
assert.equal(headers[0].name, '白山一丁目'); | ||
}); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import assert from 'node:assert'; | ||
import test from 'node:test'; | ||
|
||
import fs from 'node:fs/promises'; | ||
import main from './04_make_chiban.js'; | ||
import { getRangesFromCSV } from './10_refresh_csv_ranges.js'; | ||
|
||
test.describe('with filter for 465054 (鹿児島県熊毛郡屋久島町)', async () => { | ||
test.before(async () => { | ||
process.env.SETTINGS_JSON = JSON.stringify({ lgCodes: ['465054'] }); | ||
}); | ||
|
||
test.after(async () => { | ||
delete process.env.SETTINGS_JSON; | ||
}); | ||
|
||
test('it generates the API', async () => { | ||
await fs.rm('./out/api_kagoshima_yakushima', { recursive: true, force: true }); | ||
await main(['', '', './out/api_kagoshima_yakushima']); | ||
assert.ok(true); | ||
|
||
const headers = await getRangesFromCSV('./out/api_kagoshima_yakushima/ja/鹿児島県/熊毛郡屋久島町-地番.txt'); | ||
assert(typeof headers !== 'undefined'); | ||
assert.equal(headers[0].name, '安房'); | ||
}); | ||
}); |
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
Oops, something went wrong.