• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

suculent / thinx-device-api / #252646970

27 Oct 2017 03:17PM UTC coverage: 12.466% (+1.3%) from 11.197%
#252646970

push

suculent
added support for displaying/exporting extended SigFox attributes

37 of 1808 branches covered (2.05%)

Branch coverage included in aggregate %.

735 of 4385 relevant lines covered (16.76%)

0.17 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

26.79
/spec/jasmine/RepositorySpec.js
1
describe("Repository Watcher", function() {
1✔
2

3
  var watcher = require('../../lib/thinx/repository');
1✔
4

5
  // tests are run from ROOT
6
  var repo_path =
7
    "./spec/test_repository/thinx-firmware-esp8266-ino";
1✔
8

9
  var watcher_callback = function(result) {
1✔
10
    if (typeof(result) !== "undefined") {
×
11
      console.log("watcher_callback result: " + JSON.stringify(result));
×
12
      if (result === false) {
×
13
        console.log(
×
14
          "No change detected on repository so far."
15
        );
16
      } else {
17
        console.log(
×
18
          "CHANGE DETECTED! - TODO: Commence re-build (will notify user but needs to get all required user data first (owner/device is in path)"
19
        );
20
      }
21
    } else {
22
      console.log("watcher_callback: no result");
×
23
    }
24
    expect(true).toBe(true);
×
25
  };
26

27
  watcher.callback = function(err) {
1✔
28
    // watcher exit_callback
29
    console.log("Callback 1");
×
30
    expect(true).toBe(true);
×
31
  };
32
  watcher.exit_callback = function(err) {
1✔
33
    // watcher exit_callback
34
    console.log("Callback 2");
×
35
    expect(true).toBe(true);
×
36
  };
37

38
  beforeEach(function() {
1✔
39
    //watcher = new Watcher();
40
  });
41

42
  it("should be able to initialize", function() {
1✔
43
    expect(watcher).toBeDefined();
×
44
  });
45

46
  it("should be able to watch repository", function() {
1✔
47

48
    watcher.watchRepository(repo_path, true, function(result) {
×
49

50
      if (typeof(result) !== "undefined") {
×
51
        console.log("watcher_callback result: " + JSON.stringify(
×
52
          result));
53
        if (result === false) {
×
54
          console.log(
×
55
            "No change detected on repository so far."
56
          );
57
        } else {
58
          console.log(
×
59
            "CHANGE DETECTED! - TODO: Commence re-build (will notify user but needs to get all required user data first (owner/device is in path)"
60
          );
61
        }
62
      } else {
63
        console.log("watcher_callback: no result");
×
64
      }
65
      expect(true).toBe(true);
×
66
    });
67
  });
68

69
  if ("should be able to infer platform from repository contents", function() {
1!
70
      watcher.getPlatform(repo_path, function(error, result) {
×
71
        expect(result).toBeDefined();
×
72
        console.log("Platform: " + result);
×
73
      });
74
    });
75

76
  it("should be able tell repository has changed", function() {
1✔
77
    watcher.checkRepositoryChange(repo_path, false, function(err,
×
78
      result) {
79
      expect(true).toBe(true);
×
80
      console.log(result);
×
81
    });
82
  });
83

84
  it("should be able to unwatch repository", function() {
1✔
85
    watcher.unwatchRepository();
×
86
    expect(true).toBe(true);
×
87
  });
88

89
  it("should be able to get revision", function() {
1✔
90
    var r = watcher.getRevision();
×
91
    expect(r).toBeDefined();
×
92
  });
93

94
  it("should be able to get revision number", function() {
1✔
95
    var n = watcher.getRevisionNumber();
×
96
    expect(n).toBeDefined();
×
97
  });
98

99
});
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc