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

u-wave / core / 11980840475

22 Nov 2024 10:04PM UTC coverage: 78.492% (-1.7%) from 80.158%
11980840475

Pull #637

github

goto-bus-stop
ci: add node 22
Pull Request #637: Switch to a relational database

757 of 912 branches covered (83.0%)

Branch coverage included in aggregate %.

2001 of 2791 new or added lines in 52 files covered. (71.69%)

9 existing lines in 7 files now uncovered.

8666 of 11093 relevant lines covered (78.12%)

70.72 hits per line

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

96.43
/src/plugins/motd.js
1
import routes from '../routes/motd.js';
1✔
2

1✔
3
const CONFIG_MOTD = 'u-wave:motd';
1✔
4

1✔
5
class MOTD {
92✔
6
  #uw;
92✔
7

92✔
8
  /**
92✔
9
   * @param {import('../Uwave.js').default} uw
92✔
10
   */
92✔
11
  constructor(uw) {
92✔
12
    this.#uw = uw;
92✔
13

92✔
14
    uw.config.register(CONFIG_MOTD, {
92✔
15
      type: 'object',
92✔
16
      properties: {
92✔
17
        text: { type: 'string', nullable: true },
92✔
18
      },
92✔
19
    });
92✔
20
  }
92✔
21

92✔
22
  /**
92✔
23
   * @returns {Promise<string | null>}
92✔
24
   */
92✔
25
  async get() {
92✔
26
    const config = /** @type {{ text?: string | null } | null} */ (
4✔
27
      await this.#uw.config.get(CONFIG_MOTD)
4✔
28
    );
4✔
29

4✔
30
    return config?.text ?? null;
4✔
31
  }
4✔
32

92✔
33
  /**
92✔
34
   * @param {string|null} motd
92✔
35
   * @returns {Promise<void>}
92✔
36
   */
92✔
37
  async set(motd) {
92✔
NEW
38
    await this.#uw.config.set(CONFIG_MOTD, { text: motd });
×
39
  }
×
40
}
92✔
41

1✔
42
/**
1✔
43
 * @param {import('../Uwave.js').default} uw
1✔
44
 */
1✔
45
async function motdPlugin(uw) {
92✔
46
  uw.motd = new MOTD(uw);
92✔
47
  uw.httpApi.use('/motd', routes());
92✔
48
}
92✔
49

1✔
50
export default motdPlugin;
1✔
51
export { MOTD };
1✔
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