Fonteva requires you to create a directory called auraSpecs, a sibling of src. The package.json file is contained inside of auraSpecs.

Additionally, you need to create a directory called specs inside of the auraSpecs directory. Inside of the specs directory put the Lightning Components you want to test. Other directories in the structure will be auto-generated.

You can create your own naming convention for your components. Fonteva’s naming convention is to name the folder the same name as the component they are testing.

Each Lightning Component is bundled with two files: a controller file and a helper file. A controller file is instantiated each time the component is instantiated. The helper file is instantiated once and shared by that same component as many times as that component is instantiated. If you instantiate a component of the same type ten times, the controller file will be instantiated ten times and the helper file will be instantiated one time. 

For example: EventRegistrationFlowDetails is a Lightning Component. The unit test controller file is EventRegistrationFlowDetailsControllerSpec.js and the unit test helper file is EventRegistrationFlowDetailsHelperSpec.js.


Previous: package.json     |     Next: Example Controller File