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

kiva / ui / 19147367510

06 Nov 2025 07:26PM UTC coverage: 91.443% (+41.5%) from 49.902%
19147367510

push

github

emuvente
test: refactor category-row-arrows-visible-mixin test with runner method

3722 of 3979 branches covered (93.54%)

Branch coverage included in aggregate %.

18923 of 20785 relevant lines covered (91.04%)

78.6 hits per line

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

0.0
/src/server-entry.js
1
import fetch from 'make-fetch-happen';
×
2
import CookieStore from '#src/util/cookieStore';
×
3
import KvAuth0, { MockKvAuth0 } from '#src/util/KvAuth0';
×
4
import logFormatter from '#src/util/logFormatter';
×
5
import renderESI from '#src/server-esi-render';
×
6
import renderPage from '#src/server-app-render';
×
7

8
// custom fetch wrapper to log fetch requests
×
9
const customFetch = async (uri, options) => {
×
10
        const response = await fetch(uri, options);
×
11
        // Log the outgoing options
×
12
        logFormatter(`Fetch Options: ${uri}, Options: ${JSON.stringify(options)}`);
×
13

14
        // Log the full response
×
15
        // eslint-disable-next-line max-len
×
16
        logFormatter(`Server fetch: ${uri}, Status: ${response.status}, Headers: ${JSON.stringify(response.headers.raw())}`);
×
17

18
        return response;
×
19
};
×
20

21
// This exported function will be called by vue-render.
×
22
// This is where we perform data-prefetching to determine the
×
23
// state of our application before actually rendering it.
×
24
// Since data fetching is async, this function is expected to
×
25
// return a Promise that resolves to the rendered html and set cookies.
×
26
export default async context => {
×
27
        const {
×
28
                esi,
×
29
                config,
×
30
                cookies,
×
31
                user,
×
32
        } = context;
×
33
        const { accessToken, ...profile } = user;
×
34

35
        // Create cookie store with cookies passed from express middleware
×
36
        const cookieStore = new CookieStore(cookies);
×
37

38
        let kvAuth0;
×
39
        if (config.auth0.enable) {
×
40
                kvAuth0 = new KvAuth0({
×
41
                        accessToken,
×
42
                        checkFakeAuth: config.auth0.checkFakeAuth,
×
43
                        cookieStore,
×
44
                        domain: config.auth0.domain,
×
45
                        user: profile,
×
46
                });
×
47
        } else {
×
48
                kvAuth0 = MockKvAuth0;
×
49
        }
×
50

51
        const renderingOptions = {
×
52
                cookieStore,
×
53
                context,
×
54
                fetch: config?.apolloQueryFetchLogging ? customFetch : fetch,
×
55
                kvAuth0,
×
56
        };
×
57

58
        if (esi) {
×
59
                return renderESI(renderingOptions);
×
60
        }
×
61
        return renderPage(renderingOptions);
×
62
};
×
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