Coder Social home page Coder Social logo

Tests Needed about serverless-graphql HOT 5 CLOSED

serverless avatar serverless commented on July 29, 2024 2
Tests Needed

from serverless-graphql.

Comments (5)

laardee avatar laardee commented on July 29, 2024 2

Everyone is fighting over this one. 😄 I can give a try, though I haven't work with GraphQL much. Unless you are in a hurry, I think it will take couple days for me to get started.

Do you have any preference how tests should be done (mocha with chai or something else, etc.)?

from serverless-graphql.

laardee avatar laardee commented on July 29, 2024 2

I opened a PR so that it is easier to discuss.

It includes following tests:

  • create user
  • get users
  • get one user
  • login fails because of incorrect username
  • login fails because of incorrect password
  • successful login
  • fails to update user with bad token
  • successfully updates user
  • fails to delete user with bad token
  • successfully deletes user
  • get empty users response after deleting

There is still an issue with create user test. User is successfully created, but then function tries to invoke timeout function with lambda.invoke, which causes following error.

{ data: { createUser: null },
  errors: 
   [ { [Error: Function not found: arn:aws:lambda:us-east-1:XXXXXXXXXXXX:function:serverless-boilerplate-timeout:dev]
       message: 'Function not found: arn:aws:lambda:us-east-1:XXXXXXXXXXXX:function:serverless-boilerplate-timeout:dev',

After user creation it tries to trigger arn:aws:lambda:us-east-1:XXXXXXXXXXXX:function:serverless-boilerplate-timeout:dev function, but as it is executed locally, it can't do that. Should the invoke.js be modified to function differently when it is executed when environment variable IS_OFFLINE is true? Or should I just ignore that timeout error in the test and catch other errors? Do you have any suggestions? @ac360 @nikgraf

from serverless-graphql.

austencollins avatar austencollins commented on July 29, 2024

Thanks @laardee! We're all still new to GraphQL :) Tests done in mocha or chai are totally fine. I really appreciate your help here.

from serverless-graphql.

nikgraf avatar nikgraf commented on July 29, 2024

@laardee any progress? I would be happy to help out here over the weekend …

from serverless-graphql.

laardee avatar laardee commented on July 29, 2024

There is couple minor things left that I need to fix, otherwise I'm almost done with writing the tests. I'll try to open PR today.

from serverless-graphql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.