fac-13 / HEII-topics

website where you can log in, post topics and vote on topics
https://heii-voting-topics.herokuapp.com/
2 stars 1 forks source link

Queries #22

Closed lexadecimals closed 6 years ago

lexadecimals commented 6 years ago

Good job on all of your tests. Very impressive that you managed to set them up and write so many :corn:

At the moment all of your queries are coming from one query in the db_build.js file where you are sending through a different sql string. What you need to do now is

1- take this query outside of the db_build file. 2 - create separate queries for each query you want to make to the database.

So, you could create a folder called queries and have a page full of individual queries. Or, you could put each of these queries into their own file.

You will then need to update the tests so that they are calling the specific query rather than writing the query in a string inside the test.

Example of file of queries:

screen shot 2018-04-06 at 13 00 27
lexadecimals commented 6 years ago

I've got a better example with error handling. one sec ....

lexadecimals commented 6 years ago
screen shot 2018-04-06 at 13 07 12