Skip to content

Commit 3dcad7e

Browse files
committed
test: adopt defineDataType in test
1 parent 69a359f commit 3dcad7e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/index.test.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { fireEvent, render, screen } from '@testing-library/react'
22
import { expectTypeOf } from 'expect-type'
33
import { describe, expect, it } from 'vitest'
44

5-
import { createDataType, JsonViewer } from '../src'
5+
import { defineDataType, JsonViewer } from '../src'
66

77
function aPlusB (a: number, b: number) {
88
return a + b
@@ -258,13 +258,13 @@ describe('render <JsonViewer/> with props', () => {
258258
return null
259259
}
260260
},
261-
createDataType<string>(
262-
(value) => typeof value === 'string',
263-
(props) => {
261+
defineDataType<string>({
262+
is: (value) => typeof value === 'string',
263+
Component: (props) => {
264264
expectTypeOf(props.value).toMatchTypeOf<string>()
265265
return null
266266
}
267-
)
267+
})
268268
]}
269269
/>
270270
)

0 commit comments

Comments
 (0)