Skip to content

Commit 1a72915

Browse files
committed
✅ chore: update test
1 parent 49cca84 commit 1a72915

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packages/core/getField/index.test.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { describe, expect, it } from 'vitest'
22
import { getField } from '.'
33

44
describe('getField', () => {
5-
const obj = { name: 'asuka', age: 23, height: 158 }
5+
const obj = { name: 'asuka', age: 23, height: 158, deep: { one: '1' } }
66

77
it('default', () => {
88
expect(getField(obj, 'name')).toMatchInlineSnapshot('"asuka"')
@@ -19,4 +19,12 @@ describe('getField', () => {
1919
it('undefine', () => {
2020
expect(getField(obj, 'test')).toMatchInlineSnapshot('undefined')
2121
})
22+
23+
it('array', () => {
24+
expect(getField(obj, ['name'])).toMatchInlineSnapshot('"asuka"')
25+
})
26+
27+
it('deep array', () => {
28+
expect(getField(obj, ['deep', 'one'])).toMatchInlineSnapshot('"1"')
29+
})
2230
})

0 commit comments

Comments
 (0)