Skip to content

Vite Build fails because of test TypeScript error #1191

Closed
@rrd108

Description

@rrd108

My build fails because of typescript errors in a test

describe('SearchDetailed inAccountNumberRange', () => {
  it('returns true as no accountStart', () => {
    let wrapper = shallowMount(SearchDetailed, { global: _global, props })
    expect(wrapper.vm.inAccountNumberRange('452')).toBe(true)
  })
})

The error message is error TS2339: Property 'inAccountNumberRange' does not exist on type '{ $: ComponentInternalInstance; $data: {}; $props: Partial<{ results: Item[]; }> & Omit<Readonly<{ results?: unknown; accountStart?: unknown; accountEnd?: unknown; } & { results: Item[]; } & { ...; }> & VNodeProps & AllowedComponentProps & ComponentCustomProps, "results">; ... 10 more ...; $watch(source: string | Fu...'.

inAccountNumberRange is a method in the SearchDetailed component

The test runs fine, only the build fails.

The test is in the same folder as the component

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions