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

suculent / thinx-device-api / #252646768

01 Nov 2025 03:31PM UTC coverage: 46.298% (-25.7%) from 71.971%
#252646768

push

suculent
testing upgraded mqtt package

1123 of 3470 branches covered (32.36%)

Branch coverage included in aggregate %.

5324 of 10455 relevant lines covered (50.92%)

4.07 hits per line

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

43.18
/spec/jasmine/ZZ-RouterOAuthSpec.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
describe("OAuth", function () {
1✔
11

12
    let thx;
13

14
    beforeAll((done) => {
1✔
15
        console.log(`🚸 [chai] >>> running OAuth spec`);
1✔
16
        thx = new THiNX();
1✔
17
        thx.init(() => {
1✔
18
            done();
×
19
        });
20
    });
21
    
22
    afterAll(() => {
1✔
23
        console.log(`🚸 [chai] <<< completed OAuth spec`);
1✔
24
    });
25

26
    // Slack OAuth Integration
27

28
    it("GET /api/slack/direct_install", function (done) {
1✔
29
        chai.request(thx.app)
×
30
            .get('/api/slack/direct_install')
31
            .end((err, res) => {
32
                expect(res.status).to.equal(200);
×
33
                expect(res).to.be.html;
×
34
                done();
×
35
            });
36
    }, 30000);
37

38
    it("GET /api/slack/redirect", function (done) {
1✔
39
        chai.request(thx.app)
×
40
            .get('/api/slack/redirect?code=A&state=B')
41
            .end((err/* , res */) => {
42
                console.log("🚸 [chai] response /api/slack/redirect err (status undefined):", { err });
×
43
                expect(err.code == 'ECONNREFUSED');
×
44
                done();
×
45
            });
46
    }, 30000);
47

48
    // Github OAuth
49

50
    it("GET /api/oauth/github", function (done) {
1✔
51
        chai.request(thx.app)
×
52
            .get('/api/oauth/github')
53
            .end((err, res) => {
54
                expect(res.status).to.equal(200);
×
55
                done();
×
56
            });
57
    }, 30000);
58

59
    it("GET /api/oauth/github/callback", function (done) {
1✔
60
        chai.request(thx.app)
×
61
            .get('/api/oauth/github/callback')
62
            .end((err, res) => {
63
                console.log("🚸 [chai] response /api/oauth/github/callback status:", res.status);
×
64
                expect(res.status).to.equal(200); 
×
65
                done();
×
66
            });
67
    }, 30000);
68

69
    it("GET /api/oauth/github/callback?code=B", function (done) {
1✔
70
        chai.request(thx.app)
×
71
            .get('/api/oauth/github/callback?code=B')
72
            .end((err, res) => {
73
                expect(res.status).to.equal(200); // returns 200 with error if the code is B only, may not work in test
×
74
                done();
×
75
            });
76
    }, 30000);
77

78
    // Google OAuth
79

80
    it("GET /api/oauth/google", function (done) {
1✔
81
        chai.request(thx.app)
×
82
            .get('/api/oauth/google')
83
            .end((err, res) => {
84
                expect(res.status).to.equal(200);
×
85
                done();
×
86
            });
87
    }, 30000);
88

89
    it("GET /api/oauth/google/callback", function (done) {
1✔
90
        chai.request(thx.app)
×
91
            .get('/api/oauth/google/callback')
92
            .end((err, res) => {
93
                expect(res.status).to.equal(200);
×
94
                done();
×
95
            });
96
    }, 30000);
97
});
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