Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-shi committed Sep 3, 2020
1 parent 3589796 commit e240894
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -261,13 +261,13 @@ it('can call useStore with progressively more arguments', async () => {
it('can throw an error in selector', async () => {
console.error = jest.fn()

const initialState = { value: 'foo' }
const initialState: { value?: string } = { value: 'foo' }
const useStore = create(() => initialState)
const { setState } = useStore
const selector = (s: any) => s.value.toUpperCase()

class ErrorBoundary extends React.Component<any, { hasError: boolean }> {
constructor(props: any) {
class ErrorBoundary extends React.Component<{}, { hasError: boolean }> {
constructor(props: {}) {
super(props)
this.state = { hasError: false }
}
Expand Down Expand Up @@ -301,14 +301,14 @@ it('can throw an error in selector', async () => {
it('can throw an error in equality checker', async () => {
console.error = jest.fn()

const initialState = { value: 'foo' }
const initialState: { value?: string } = { value: 'foo' }
const useStore = create(() => initialState)
const { setState } = useStore
const selector = (s: any) => s
const equalityFn = (a: any, b: any) => a.value.trim() === b.value.trim()

class ErrorBoundary extends React.Component<any, { hasError: boolean }> {
constructor(props: any) {
class ErrorBoundary extends React.Component<{}, { hasError: boolean }> {
constructor(props: {}) {
super(props)
this.state = { hasError: false }
}
Expand Down

0 comments on commit e240894

Please sign in to comment.