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

coderaiser / cloudcmd / 26469338489

26 May 2026 07:08PM UTC coverage: 49.248% (+0.5%) from 48.774%
26469338489

push

github

coderaiser
feature: cloudcmd: ratelimit: X-Forwarded-For (#437)

347 of 440 branches covered (78.86%)

35 of 57 new or added lines in 3 files covered. (61.4%)

13 existing lines in 2 files now uncovered.

3800 of 7716 relevant lines covered (49.25%)

9.58 hits per line

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

61.36
/test-e2e/ratelimit.js
1
import process from 'node:process';
3✔
2
import {test} from 'supertape';
3✔
3

3✔
4
let i = 0;
3✔
5

3✔
6
test('cloudcmd: server: ratelimit: x-forwarded-for', async (t) => {
3✔
7
    const PORT = 3000;
3✔
8
    
3✔
9
    process.env.PORT = PORT;
3✔
10
    process.env.CLOUDCMD_LOG = 0;
3✔
11
    
3✔
12
    await import('../bin/cloudcmd.js');
3✔
13
    
3✔
14
    const {status} = await fetch(`http://localhost:${PORT}`, {
3✔
15
        headers: {
3✔
16
            'X-Forwarded-For': '127.0.0.1',
3✔
17
        },
3✔
18
    });
3✔
19
    
3✔
20
    process.kill(process.pid, 'SIGUSR1');
3✔
21
    
3✔
22
    t.notEqual(status, 500);
3✔
23
    t.end();
3✔
24
});
3✔
25

3✔
26
test('cloudcmd: server: ratelimit', async (t) => {
3✔
NEW
27
    const PORT = 3001;
×
NEW
28
    const STATUS = 429;
×
NEW
29
    
×
NEW
30
    process.env.PORT = PORT;
×
NEW
31
    process.env.CLOUDCMD_LOG = 0;
×
NEW
32
    
×
NEW
33
    await import(`../bin/cloudcmd.js?${i++}`);
×
NEW
34
    
×
NEW
35
    for (let i = 0; i < 1000; i++) {
×
NEW
36
        await fetch(`http://localhost:${PORT}`);
×
NEW
37
    }
×
NEW
38
    
×
NEW
39
    const {status} = await fetch(`http://localhost:${PORT}`);
×
NEW
40
    process.kill(process.pid, 'SIGUSR1');
×
NEW
41
    
×
NEW
42
    t.equal(status, STATUS);
×
NEW
43
    t.end();
×
44
});
3✔
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