Skip to content

Commit

Permalink
Add a test
Browse files Browse the repository at this point in the history
  • Loading branch information
kamataryo committed Aug 1, 2023
1 parent f3030fc commit 6dbec51
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/advanced/interface_v2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ config.transformRequest = async (url, query) => {
return [
{ addr: '1-1', lat: '30.1', lng: '135.1' },
{ addr: '1-2', lat: '30.2', lng: '135.2' },
{ addr: '2-3', lat: null, lng: null },
]
}
}
Expand Down Expand Up @@ -86,3 +87,19 @@ test('リクエスト変形テスト 2', async () => {
lat: 30.2,
})
})

test('リクエスト変形テスト - レベル8 で緯度経度が null の時はレベル3の緯度経度を使う', async () => {
const res = await normalize('A県 X市 あああ 2の3 こんばんはビル', {
level: 8,
})
expect(res).toStrictEqual({
pref: 'A県',
city: 'X市',
town: 'あああ',
addr: '2-3',
other: 'こんばんはビル',
lng: 135,
level: 8,
lat: 30,
})
})

0 comments on commit 6dbec51

Please sign in to comment.