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

suculent / thinx-device-api / #252646960

14 Mar 2026 04:35PM UTC coverage: 52.052% (-10.0%) from 62.077%
#252646960

push

suculent
Revert test bootstrap experiments to baseline

1399 of 3653 branches covered (38.3%)

Branch coverage included in aggregate %.

27 of 40 new or added lines in 3 files covered. (67.5%)

1153 existing lines in 32 files now uncovered.

5996 of 10554 relevant lines covered (56.81%)

10.32 hits per line

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

55.32
/spec/jasmine/ZZ-RouterNotificationsSpec.js
1
/* Router integration test only; does not have to cover full unit functionality. */
2

3
const THiNX = require("../../thinx-core.js");
1✔
4

5
let chai = require('chai');
1✔
6
var expect = require('chai').expect;
1✔
7
let chaiHttp = require('chai-http');
1✔
8
chai.use(chaiHttp);
1✔
9

10
var envi = require("../_envi.json");
1✔
11

12
let thx;
13

14
describe("Actionable Notification (noauth)", function () {
1✔
15

16
    it("POST /api/device/notification", function (done) {
1✔
17
        thx = new THiNX();
1✔
18
        thx.init(() => {
1✔
19
            chai.request(thx.app)
×
20
                .post('/api/device/notification')
21
                .send({})
22
                .end((err, res) => {
23
                    expect(res.status).to.equal(401);
×
24
                    done();
×
25
                });
26
        });
27
    }, 30000);
28
    
29
});
30

31
describe("Actionable Notification (JWT)", function () {
1✔
32

33
    let agent;
34
    let jwt;
35
  
36
    beforeAll((done) => {
1✔
37
        agent = chai.request.agent(thx.app);
1✔
38
        agent
1✔
39
            .post('/api/login')
40
            .send({ username: 'dynamic', password: 'dynamic', remember: false })
41
            .then(function (res) {
42
                expect(res).to.have.cookie('x-thx-core');
1✔
UNCOV
43
                let body = JSON.parse(res.text);
×
UNCOV
44
                jwt = 'Bearer ' + body.access_token;
×
UNCOV
45
                done();
×
46
            })
47
            .catch((e) => { console.log(e); });
1✔
48
    });
49
  
50
    afterAll((done) => {
1✔
51
        agent.close();
1✔
52
        if (thx && thx.server) thx.server.close();
1!
53
        done();
1✔
54
    });
55

56
    it("POST /api/device/notification (jwt, invalid)", function (done) {
1✔
UNCOV
57
        chai.request(thx.app)
×
58
                .post('/api/device/notification')
59
                .set('Authorization', jwt)
60
                .send({})
61
                .end((err, res) => {
UNCOV
62
                    expect(res.status).to.equal(200);
×
UNCOV
63
                    expect(res.text).to.be.a('string');
×
UNCOV
64
                    expect(res.text).to.equal('{"success":false,"response":"missing_udid"}');
×
UNCOV
65
                    done();
×
66
                });
67
    }, 30000);
68

69
    it("POST /api/device/notification (jwt, undefined)", function (done) {
1✔
UNCOV
70
        chai.request(thx.app)
×
71
                .post('/api/device/notification')
72
                .set('Authorization', jwt)
73
                .send({ udid: undefined, reply: undefined})
74
                .end((err, res) => {
UNCOV
75
                    expect(res.status).to.equal(200);
×
UNCOV
76
                    expect(res.text).to.equal('{"success":false,"response":"missing_udid"}');
×
UNCOV
77
                    done();
×
78
                });
79
    }, 30000);
80

81
    it("POST /api/device/notification (jwt, valid)", function (done) {
1✔
UNCOV
82
        chai.request(thx.app)
×
83
                .post('/api/device/notification')
84
                .set('Authorization', jwt)
85
                .send({ udid: envi.udid, reply: "reply"} )
86
                .end((err, res) => {
UNCOV
87
                    expect(res.status).to.equal(200);
×
UNCOV
88
                    expect(res.text).to.be.a('string');
×
UNCOV
89
                    expect(res.text).to.equal('{"success":true,"response":"published"}');
×
UNCOV
90
                    done();
×
91
                });
92
    }, 30000);
93
});
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc