I'm new to unit testing using the Mocha & should.js. I'm using the Mocha's BDD for testing my application. The application I'm testing has different components like account, products & order. Before moving the code to the git repository I want to test all aspects of the application. I've different test files for all the components. For example, account.js for account, order.js for order & so on.
I want to test all the components against a temporary test account. So the flow is:
- Create test account
- Test all functionality related to account (update profile, change password etc)
- Test all functionality of the account's product
- Test all functionality of the account's order
- Delete the test account & all info related to it
My question is how do I make sure the temporary account is created before executing other tests?
Since I've test cases in different file how do I make sure they are executed in the same order as mentioned above? Is there any other better way to test the application?
Thanks.