CursosEmpresasBlogLiveConfPrecios

Testing

Clase 13 de 23 • Curso Avanzado de Node.js con GraphQL, Apollo Server y Prisma

Clase anteriorSiguiente clase
    Miguel Hernández

    Miguel Hernández

    student•
    hace 4 años

    Al aplicar test usando la version 16.x de graphql los test fallan, recomiendo usar la versión 15.8.0 o una versión similar, cuando aplique los test con la versión 16.x me aparecio: Expected undefined to be a GraphQL schema.

    No estoy seguro pero creo que es por easygraphql-tester ya que usa la versión 15 y lleva más de 10 meses sin actualizarse

    Yasniel Fajardo Egues

    Yasniel Fajardo Egues

    student•
    hace 4 años

    tengo un error que no de me deja avanzar amigo en esta parte del test: export const createMockContext = (): MockResolverContext => { return { orm: mockDeep<PrismaClient>(), user: undefined }; };

    El error es el siguiente: Type of property 'OR' circularly references itself in mapped type '{ [K in keyof { AND?: Enumerable<UserScalarWhereWithAggregatesInput>; OR?: Enumerable<UserScalarWhereWithAggregatesInput>; ... 7 more ...; updatedAt?: string | ... 1 more ... | DateTimeWithAggregatesFilter; }]: Or<...> extends 1 ? { ...; }[K] extends infer TK ? GetHavingFields<...> : never : {} extends FieldPaths<.....'.

      Steve Anthony Luzquiños Agama

      Steve Anthony Luzquiños Agama

      student•
      hace 4 años

      Tengo el mismo problema, no sé cómo lo solucionó el profesor.

      Steve Anthony Luzquiños Agama

      Steve Anthony Luzquiños Agama

      student•
      hace 4 años

      Hay un issue relacionado con este problema.

    David Rodriguez

    David Rodriguez

    student•
    hace 3 años

    Una alternativa para hacer los Test es con Cypress. ya existe un curso en platzi.

    cypress_test.png

    const apiGraphQL = `${Cypress.env('apiUrl')}/graphql`; describe('Avocados Queries and Mutations', function () { context('/graphql', function () { it('Gets a list of users', function () { cy.request('POST', `${apiGraphQL}`, { query: `query { users { id username } }`, }).then((response) => { expect(response.status).to.eq(200); expect(response.body.data.users[0].id).to.eq(1); }); }); it('Gets a list of Avocados', function () { cy.request('POST', `${apiGraphQL}`, { query: `query { avos { id name } }`, }).then((response) => { expect(response.status).to.eq(200); expect(response.body.data.avos[0].name).to.eq('Fuerte Avocado'); }); }); it('Gets a Avocado by ID', function () { cy.request('POST', `${apiGraphQL}`, { query: `query Query($avoId: ID!) { avo(id: $avoId) { id name } }`, variables: { avoId: 5, }, }).then((response) => { expect(response.status).to.eq(200); expect(response.body.data.avo.name).to.eq('Hass Avocado'); }); }); }); });
      Wingsoft Academy

      Wingsoft Academy

      student•
      hace 3 años

      link del curso por favor

      Jhunior Eduardo Guevara Lázaro

      Jhunior Eduardo Guevara Lázaro

      student•
      hace 3 años

      Link del curso recién horneado

    Irving Juárez

    Irving Juárez

    student•
    hace 4 meses

    Este maestro cambia la mano en la que trae su reloj, eso me parece raro

Escuelas

  • Desarrollo Web
  • English Academy
  • Marketing Digital
  • Inteligencia Artificial y Data Science
  • Ciberseguridad
  • Liderazgo y Habilidades Blandas
  • Diseño de Producto y UX
  • Contenido Audiovisual
  • Desarrollo Móvil
  • Diseño Gráfico y Arte Digital
  • Programación
  • Negocios
  • Blockchain y Web3
  • Recursos Humanos
  • Finanzas e Inversiones
  • Startups
  • Cloud Computing y DevOps

Platzi y comunidad

  • Platzi Business
  • Live Classes
  • Lanzamientos
  • Executive Program
  • Trabaja con nosotros
  • Podcast

Recursos

  • Manual de Marca

Soporte

  • Preguntas Frecuentes
  • Contáctanos

Legal

  • Términos y Condiciones
  • Privacidad
Reconocimientos
Reconocimientos
Logo reconocimientoTop 40 Mejores EdTech del mundo · 2024
Logo reconocimientoPrimera Startup Latina admitida en YC · 2014
Logo reconocimientoPrimera Startup EdTech · 2018
Logo reconocimientoCEO Ganador Medalla por la Educación T4 & HP · 2024
Logo reconocimientoCEO Mejor Emprendedor del año · 2024
De LATAM conpara el mundo
YoutubeInstagramLinkedInTikTokFacebookX (Twitter)Threads