Now that you’ve finished Part 1 and your Event Recommender class is complete, you’ll write Jasmine tests to ensure your code works as expected.
module.exports = { EventRecommender, User, Event}
This line enables other JS files to use the classes you defined. If your classes are named differently, update that line to match the classes you wrote.npm install jasmine -g
(it will install Jasmine globally)jasmine init
(it will initialize Jasmine in your project, creates jasmine.json
with Jasmine settings)spec
folder created after you ran jasmine init
, make a new file called eventRecommenderSpec.js
and copy the code from this file into it.jasmine
(it will start your tests).jasmine
again to check your tests. This might take a while but is good practice for debugging both your tests and your code.findEventsByDate
and findEventsByCategory