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

mongodb-js / mongodb-mcp-server / 16292877152

15 Jul 2025 12:10PM UTC coverage: 77.385% (+2.1%) from 75.27%
16292877152

push

github

web-flow
chore(tests): switch to vitest (#363)

498 of 687 branches covered (72.49%)

Branch coverage included in aggregate %.

0 of 27 new or added lines in 2 files covered. (0.0%)

293 existing lines in 26 files now uncovered.

2828 of 3611 relevant lines covered (78.32%)

28.46 hits per line

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

73.17
/src/helpers/container.ts
1
import fs from "fs/promises";
2✔
2

3
let containerEnv: boolean | undefined;
2✔
4

5
export async function detectContainerEnv(): Promise<boolean> {
47✔
6
    if (containerEnv !== undefined) {
47✔
7
        return containerEnv;
17✔
8
    }
17✔
9

10
    const detect = async function (): Promise<boolean> {
30✔
11
        if (process.platform !== "linux") {
30!
12
            return false; // we only support linux containers for now
×
UNCOV
13
        }
×
14

15
        if (process.env.container) {
30!
16
            return true;
×
UNCOV
17
        }
×
18

19
        const exists = await Promise.all(
30✔
20
            ["/.dockerenv", "/run/.containerenv", "/var/run/.containerenv"].map(async (file) => {
30✔
21
                try {
90✔
22
                    await fs.access(file);
90!
23
                    return true;
×
24
                } catch {
90✔
25
                    return false;
90✔
26
                }
90✔
27
            })
30✔
28
        );
30✔
29

30
        return exists.includes(true);
30✔
31
    };
30✔
32

33
    containerEnv = await detect();
30✔
34
    return containerEnv;
30✔
35
}
30✔
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

© 2025 Coveralls, Inc