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

u-wave / core / 11980470338

22 Nov 2024 09:32PM UTC coverage: 78.436% (-1.7%) from 80.16%
11980470338

Pull #637

github

goto-bus-stop
explicitly store UTC in sqlite
Pull Request #637: Switch to a relational database

757 of 915 branches covered (82.73%)

Branch coverage included in aggregate %.

1977 of 2768 new or added lines in 52 files covered. (71.42%)

9 existing lines in 7 files now uncovered.

8653 of 11082 relevant lines covered (78.08%)

70.79 hits per line

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

96.3
/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} */ (await this.#uw.config.get(CONFIG_MOTD));
4✔
27

4✔
28
    return config?.text ?? null;
4✔
29
  }
4✔
30

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

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

1✔
48
export default motdPlugin;
1✔
49
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