Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test issues #8

Closed
bfwalton opened this issue Sep 15, 2016 · 2 comments
Closed

Test issues #8

bfwalton opened this issue Sep 15, 2016 · 2 comments
Assignees
Labels

Comments

@bfwalton
Copy link
Collaborator

The tests are testing to see if a promise is null instead of checking the promise value to see if its returning the correct data. Is this intended?

Also testing with the id's in the database may not be the best way since it will fail every time after the first test, specifically the delete test

@koopaluigi
Copy link
Collaborator

The tests for now were just testing to make sure the function was returning a value other than null. They were just set up for future testing purposes, more assertions can be added.

I know the database may not be up and running yet but if it is there is trouble connecting to it. I have added the create player before the tests and the controller does not correctly add the player to the database and instead returns this error from the database controller:

Debugger listening on port 15454
/home/ubuntu/workspace/BaseballSim/Controller/DatabaseController.js:9
client.query(query, args, function(err, result){
^

TypeError: Cannot read property 'query' of null
at /home/ubuntu/workspace/BaseballSim/Controller/DatabaseController.js:9:22
at null. (/home/ubuntu/workspace/BaseballSim/node_modules/pg/node_modules/pg-pool/index.js:62:11)
at /home/ubuntu/workspace/BaseballSim/node_modules/pg/node_modules/pg-pool/node_modules/generic-pool/lib/generic-pool.js:339:9
at null. (/home/ubuntu/workspace/BaseballSim/node_modules/pg/node_modules/pg-pool/index.js:45:7)
at null. (/home/ubuntu/workspace/BaseballSim/node_modules/pg/lib/client.js:185:5)
at emitOne (events.js:77:13)
at emit (events.js:169:7)
at Socket. (/home/ubuntu/workspace/BaseballSim/node_modules/pg/lib/connection.js:71:10)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)

Process exited with code: 1

@bfwalton
Copy link
Collaborator Author

Hey,

I looked into the issue. This issue occurs when it cannot connect to a Postgres server. The way I've been testing is having a postgres server running on my personal machine. I added code to display a less generic error message instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants