mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 12:55:22 +00:00
Restructured Test Suite
- 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 ```
This commit is contained in:
25
tests/unit/global_vars/root_path_spec.js
Normal file
25
tests/unit/global_vars/root_path_spec.js
Normal file
@@ -0,0 +1,25 @@
|
||||
var fs = require("fs");
|
||||
var path = require("path");
|
||||
var chai = require("chai");
|
||||
var expect = chai.expect;
|
||||
|
||||
describe("'global.root_path' set in js/app.js", function() {
|
||||
var appMM = require("../../../js/app.js")
|
||||
|
||||
var expectedSubPaths = [
|
||||
"modules",
|
||||
"serveronly",
|
||||
"js",
|
||||
"js/app.js",
|
||||
"js/main.js",
|
||||
"js/electron.js",
|
||||
"config"
|
||||
];
|
||||
|
||||
expectedSubPaths.forEach(subpath => {
|
||||
it(`contains a file/folder "${subpath}"`, function() {
|
||||
expect(fs.existsSync(path.join(global.root_path, subpath))).to.equal(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user