When trying to debug why the tests broke for
https://github.com/MichMich/MagicMirror/pull/2946 I found that the tests
does not wait for the app to start and close. So if the startup isn't
blocking that would fail.
So I added a callback for `close()` too and converted them to promises
for the `startApplication()` and `stopApplication()` and updated all the
e2e tests to await both. Will try to refactor all these callbacks to
promises in a later PR.
- separated tests into e2e and unit directories
- created configs directory structure to support test framework
- added/modified `npm run test`, `npm run test:unit` and `npm run test:e2e` to target all, unit and e2e tests respectively
- modified some of the test names to be more descriptive
New structure of the Test Suite has following directory tree:
```
tests
├── configs
│ ├── env.js
│ └── modules
│ ├── clock
│ │ ├── clock_12hr.js
│ │ ├── clock_24hr.js
│ │ └── clock_showPeriodUpper.js
│ └── helloworld
│ └── helloworld.js
├── e2e
│ ├── env_spec.js
│ └── modules
│ ├── clock_spec.js
│ └── helloworld_spec.js
└── unit
├── functions
│ └── cmp_versions_spec.js
└── global_vars
└── root_path_spec.js
```