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

u-wave / core / 20918235964

12 Jan 2026 11:47AM UTC coverage: 86.599% (+0.6%) from 86.039%
20918235964

push

github

web-flow
Add hacky delay to stabilise waitlist test (#743)

1025 of 1220 branches covered (84.02%)

Branch coverage included in aggregate %.

10626 of 12234 relevant lines covered (86.86%)

105.77 hits per line

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

93.26
/src/controllers/server.js
1
import { UnknownConfigError } from '../errors/index.js';
1✔
2
import toItemResponse from '../utils/toItemResponse.js';
1✔
3

1✔
4
/**
1✔
5
 * @type {import('../types.js').Controller}
1✔
6
 */
1✔
7
async function getServerTime(req) {
×
8
  return toItemResponse({
×
9
    time: Date.now(),
×
10
  }, { url: req.fullUrl });
×
11
}
×
12

1✔
13
/**
1✔
14
 * @type {import('../types.js').AuthenticatedController}
1✔
15
 */
1✔
16
async function getAllConfig(req) {
3✔
17
  const { config } = req.uwave;
3✔
18
  const includeSchema = 'schema' in req.query;
3✔
19
  const values = await config.getAllConfig();
3✔
20

3✔
21
  return toItemResponse(values, {
3✔
22
    url: req.fullUrl,
3✔
23
    meta: includeSchema ? { schema: config.getSchema() } : {},
3✔
24
  });
3✔
25
}
3✔
26

1✔
27
/**
1✔
28
 * @type {import('../types.js').AuthenticatedController}
1✔
29
 */
1✔
30
async function getConfig(req) {
6✔
31
  const { config } = req.uwave;
6✔
32
  const { key } = req.params;
6✔
33
  const includeSchema = 'schema' in req.query;
6✔
34

6✔
35
  const values = await config.get(key);
6✔
36
  const combinedSchema = config.getSchema();
6✔
37
  const schema = combinedSchema.properties[key];
6✔
38

6✔
39
  if (schema === undefined) {
6✔
40
    throw new UnknownConfigError({ key });
2✔
41
  }
2✔
42

4✔
43
  return toItemResponse(values ?? {}, {
6!
44
    url: req.fullUrl,
6✔
45
    meta: includeSchema ? { schema } : {},
6✔
46
  });
6✔
47
}
6✔
48

1✔
49
/**
1✔
50
 * @type {import('../types.js').AuthenticatedController}
1✔
51
 */
1✔
52
async function updateConfig(req) {
6✔
53
  const { config } = req.uwave;
6✔
54
  const { key } = req.params;
6✔
55
  const values = req.body;
6✔
56

6✔
57
  const combinedSchema = config.getSchema();
6✔
58
  const schema = combinedSchema.properties[key];
6✔
59
  if (schema === undefined) {
6✔
60
    throw new UnknownConfigError({ key });
2✔
61
  }
2✔
62

4✔
63
  await config.set(key, values, { user: req.user });
4✔
64

3✔
65
  return toItemResponse({}, {
3✔
66
    url: req.fullUrl,
3✔
67
  });
3✔
68
}
6✔
69

1✔
70
export {
1✔
71
  getServerTime,
1✔
72
  getAllConfig,
1✔
73
  getConfig,
1✔
74
  updateConfig,
1✔
75
};
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