Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

125
Visualizações
Jest typescript - The 'AsymmetricMatcher' is not assignable to type string

I am new to jest and testing with typescript. I am having the above error in one of my test files. I searched a lot but couldn't find either the reason or the problem. I have other test files with the same value object id:expect.any(String) but they have no error.

Here are the sample files:

branchDetail.ts

    export interface BranchDetailsModel {
        id: string;
        brandId: string;
        name?: string;
        address?: string;
        employeeName?: string;
        position?: string;
        mobileNumber?: string;
    }

brand.spec.ts

...
const testBranchDetail: BranchDetailsModel = {
    id: expect.any(String), //Type 'AsymmetricMatcher' is not assignable to type 'string'.
    brandId: '',
    address: 'address',
    employeeName: 'sample',
    mobileNumber: 'sample',
    position: 'sample',
};
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda