Comments (5)
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.
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.
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.
@laardee any progress? I would be happy to help out here over the weekend …
from serverless-graphql.
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)
- An error occurred: GraphiqlLambdaFunction - Value of property Variables must be an object with String (or simple type) properties. HOT 1
- Use AppSync with Amazon RDS HOT 10
- Add aws Amplify Client HOT 1
- Unable to connect client to appsync api. HOT 3
- Fix missing query arg in apollo-client
- AppSync & RDS HOT 4
- Region AppSync <> DynamoDB HOT 1
- How does @aws_subscribe work in a Apollo + Lambda work?
- Error: only one instance of babel-polyfill is allowed HOT 8
- Appsync OPENID_CONNECT support? HOT 3
- Configuration for app-backend/appsync/dynamo? HOT 1
- Error: DynamoRole already exists HOT 1
- Migrate app-backend/rest-api to Apollo Server 2.0 HOT 4
- Bump babel/jest/webpack dependencies
- Playground is and graphiql loading with error HOT 1
- Request AppSync DataSource HTTP type
- Got error when run yarn install HOT 3
- Yarn start in `app-backend/dynamodb` does not start dynamodb on port 8000 HOT 1
- multiple @connection to same child table possible? HOT 1
- Batch mutations seem to create separate AWS Lambda invocations
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from serverless-graphql.