mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 12:55:22 +00:00
Merge branch 'updatenotification' into logger
This commit is contained in:
29
tests/unit/functions/updatenotification_spec.js
Normal file
29
tests/unit/functions/updatenotification_spec.js
Normal file
@@ -0,0 +1,29 @@
|
||||
const path = require("path");
|
||||
const git_Helper = require("../../../modules/default/updatenotification/git_helper.js");
|
||||
const gitHelper = new git_Helper.gitHelper();
|
||||
gitHelper.add("default");
|
||||
let branch = "";
|
||||
|
||||
describe("Updatenotification", function () {
|
||||
// it is assumed that we are at the HEAD of a branch when running this tests
|
||||
// and we have no foreign modules installed.
|
||||
|
||||
it("should return 0 for repo count", async function () {
|
||||
const arr = await gitHelper.getRepos();
|
||||
expect(arr.length).toBe(0);
|
||||
}, 15000);
|
||||
|
||||
it("should return valid output for git status", async function () {
|
||||
const arr = await gitHelper.getStatus();
|
||||
expect(arr.length).toBe(1);
|
||||
const gitInfo = arr[0];
|
||||
branch = gitInfo.current;
|
||||
expect(gitInfo.current).not.toBe("");
|
||||
}, 15000);
|
||||
|
||||
it("should return no refs for git fetch", async function () {
|
||||
const baseDir = path.normalize(__dirname + "/../../../");
|
||||
const res = await gitHelper.execShell("cd " + baseDir + " && git fetch --dry-run");
|
||||
expect(res.stderr.match(gitHelper.getRefRegex(branch))).toBe(null);
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user