snoryder8019 / rw_socket

1 stars 0 forks source link

Mocha Tests ~ adminFunctions #41

Open snoryder8019 opened 3 months ago

snoryder8019 commented 3 months ago

Lets begin testing any completed /routes/adminFunctions. package.json update "scripts" with "test" : "mocha ./bin/www"

Completed functions: webappSettings, subcriptions, clubs, sectionsSettings, notificcations, chatRoom, ChatMessage are all EP's that only need slight modeling adjustments.

dependency files would be models in /plugins/mongo/models && .../games /plugins/helpers/formHelper.js && imagesArray.js /routes/helpers/routeBuilder.js

views: /admin/admin.ejs && the matching subdirectories

ignore testing: videoLead, users, travel, videoProduction, help, permissions, When you get something built out, I need a walk through of what needs to happen if i make a change to a function that has a test written.

I hope to have an overhaul of the login portal soon and we can move onto testing that.

gmr5311 commented 3 months ago

Ran into a bit of a snag on this one. I've having some trouble getting the testing framework to play nicely with pre es6 syntax that's being used here. I started up a new branch to see if I can get the project converted over to the new style and then I'll continue on the testing branch.

snoryder8019 commented 2 months ago

Convention: /routes/adminFunctions/DIRNAMES/FILENAME.js First Test: /routes/adminFunctions/clubs/clubs.js

There are some custom functions in these, but theres a repeated standard of renderAddForm(), renderEditForm() , and the section/ upload-images EPs. Could we start Mocha here with clubs, but just run down the directory for the same naming conventions in a single expectation?

Expectations using clubs.js as my example: renderAddform - expect:200, expect formFields:obj, expect model:obj error expect renderEditForm/:id - expect:200, expect id: str, expect formFields:obj, expect model:obj section- expect:200,expect data:obj

bugs today: imagesArray(Club), uploadMultiple may not function as expected. I am wrapping these up today 8-28-14.

snoryder8019 commented 2 months ago

oops, i didnt finish the error expectations, but I think you get it bette than I.

snoryder8019 commented 2 months ago

Hold on this until October! Thanks. I need bugs and email for a solid launch.

snoryder8019 commented 2 months ago

Let me know how we can imporve the structer of testing I having gone through its errors to debug yet....run "npm test" for more info.