Skip to content

Fix tests that fail when DISPLAY_UNITS=mmol#8378

Open
earldouglas wants to merge 1 commit intonightscout:devfrom
earldouglas:issue-8353
Open

Fix tests that fail when DISPLAY_UNITS=mmol#8378
earldouglas wants to merge 1 commit intonightscout:devfrom
earldouglas:issue-8353

Conversation

@earldouglas
Copy link

Some of the tests check for values in units of mg/dL. These fail when the DISPLAY_UNITS environment variable is set to mmol or mmol/L.

The failures can be reproduced with:

$ DISPLAY_UNITS=mmol npm run-script test
$ DISPLAY_UNITS=mmol/L npm run-script test

This change fixes the failing cases by first checking the configured units, and then choosing an expected value accordingly.

This fix was tested with:

$ npm run-script test
$ DISPLAY_UNITS=mg/dl npm run-script test
$ DISPLAY_UNITS=mmol npm run-script test
$ DISPLAY_UNITS=mmol/L npm run-script test

Fixes #8353

Some of the tests check for values in units of mg/dL.  These fail when
the `DISPLAY_UNITS` environment variable is set to `mmol` or `mmol/L`.

The failures can be reproduced with:

```
$ DISPLAY_UNITS=mmol npm run-script test
$ DISPLAY_UNITS=mmol/L npm run-script test
```

This change fixes the failing cases by first checking the configured
units, and then choosing an expected value accordingly.

This fix was tested with:

```
$ npm run-script test
$ DISPLAY_UNITS=mg/dl npm run-script test
$ DISPLAY_UNITS=mmol npm run-script test
$ DISPLAY_UNITS=mmol/L npm run-script test
```

Fixes nightscout#8353
@earldouglas earldouglas marked this pull request as ready for review June 28, 2025 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant