timoschlueter / nightscout-librelink-up

Script written in TypeScript that uploads CGM readings from LibreLink Up to Nightscout.
MIT License
208 stars 259 forks source link

Problem with build docker image #116

Closed maskac closed 8 months ago

maskac commented 1 year ago

jest --coverage --forceExit

FAIL tests/unit-tests/librelink/librelink.test.ts ● Test suite failed to run

src/index.ts:169:17 - error TS2322: Type 'LibreLinkUpHttpHeaders' is not assignable to type 'AxiosHeaders | (Partial<RawAxiosHeaders & { "User-Agent": AxiosHeaderValue; Authorization: AxiosHeaderValue; Accept: AxiosHeaderValue; "Content-Length": AxiosHeaderValue; "Content-Encoding": AxiosHeaderValue; } & { ...; }> & Partial<...>) | undefined'.
  Type 'LibreLinkUpHttpHeaders' is not assignable to type 'Partial<RawAxiosHeaders & { "User-Agent": AxiosHeaderValue; Authorization: AxiosHeaderValue; Accept: AxiosHeaderValue; "Content-Length": AxiosHeaderValue; "Content-Encoding": AxiosHeaderValue; } & { ...; }> & Partial<...>'.
    Type 'LibreLinkUpHttpHeaders' is not assignable to type 'Partial<{ link: AxiosHeaders; get: AxiosHeaders; delete: AxiosHeaders; head: AxiosHeaders; options: AxiosHeaders; ... 4 more ...; unlink: AxiosHeaders; } & { ...; }>'.
      Types of property 'link' are incompatible.
        Type 'string | string[] | undefined' is not assignable to type 'AxiosHeaders | undefined'.
          Type 'string' is not assignable to type 'AxiosHeaders'.

169                 headers: libreLinkUpHttpHeaders
                    ~~~~~~~
src/index.ts:213:17 - error TS2322: Type 'LibreLinkUpHttpHeaders' is not assignable to type 'AxiosHeaders | (Partial<RawAxiosHeaders & { "User-Agent": AxiosHeaderValue; Authorization: AxiosHeaderValue; Accept: AxiosHeaderValue; "Content-Length": AxiosHeaderValue; "Content-Encoding": AxiosHeaderValue; } & { ...; }> & Partial<...>) | undefined'.

213                 headers: getLluAuthHeaders()
                    ~~~~~~~
src/index.ts:233:17 - error TS2322: Type 'LibreLinkUpHttpHeaders' is not assignable to type 'AxiosHeaders | (Partial<RawAxiosHeaders & { "User-Agent": AxiosHeaderValue; Authorization: AxiosHeaderValue; Accept: AxiosHeaderValue; "Content-Length": AxiosHeaderValue; "Content-Encoding": AxiosHeaderValue; } & { ...; }> & Partial<...>) | undefined'.

233                 headers: getLluAuthHeaders()
                    ~~~~~~~
src/index.ts:283:13 - error TS2322: Type 'NightScoutHttpHeaders' is not assignable to type 'AxiosHeaders | (Partial<RawAxiosHeaders & { "User-Agent": AxiosHeaderValue; Authorization: AxiosHeaderValue; Accept: AxiosHeaderValue; "Content-Length": AxiosHeaderValue; "Content-Encoding": AxiosHeaderValue; } & { ...; }> & Partial<...>) | undefined'.
  Type 'NightScoutHttpHeaders' is not assignable to type 'Partial<RawAxiosHeaders & { "User-Agent": AxiosHeaderValue; Authorization: AxiosHeaderValue; Accept: AxiosHeaderValue; "Content-Length": AxiosHeaderValue; "Content-Encoding": AxiosHeaderValue; } & { ...; }> & Partial<...>'.
    Type 'NightScoutHttpHeaders' is not assignable to type 'Partial<{ link: AxiosHeaders; get: AxiosHeaders; delete: AxiosHeaders; head: AxiosHeaders; options: AxiosHeaders; ... 4 more ...; unlink: AxiosHeaders; } & { ...; }>'.
      Types of property 'link' are incompatible.
        Type 'string | string[] | undefined' is not assignable to type 'AxiosHeaders | undefined'.

283             headers: nightScoutHttpHeaders
                ~~~~~~~
src/index.ts:344:21 - error TS2322: Type 'NightScoutHttpHeaders' is not assignable to type 'AxiosHeaders | (Partial<RawAxiosHeaders & { "User-Agent": AxiosHeaderValue; Authorization: AxiosHeaderValue; Accept: AxiosHeaderValue; "Content-Length": AxiosHeaderValue; "Content-Encoding": AxiosHeaderValue; } & { ...; }> & Partial<...>) | undefined'.

344                     headers: nightScoutHttpHeaders
                        ~~~~~~~
PASS tests/unit-tests/helpers/helpers.test.ts (28.064 s) ----------------------------- --------- ---------- --------- --------- ------------------- File % Stmts % Branch % Funcs % Lines Uncovered Line #s
All files 100 100 100 100
constants 100 100 100 100
nightscout-trend-arrows.ts 100 100 100 100
helpers 100 100 100 100
helpers.ts 100 100 100 100
----------------------------- --------- ---------- --------- --------- -------------------

Test Suites: 1 failed, 1 passed, 2 total Tests: 2 passed, 2 total Snapshots: 0 total Time: 28.549 s Ran all test suites. Force exiting Jest: Have you considered using --detectOpenHandles to detect async operations that kept running after all tests finished?

timoschlueter commented 8 months ago

This should be fixed in version 2.5.0+.