cozy-client 29.1.2 → 29.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2550,7 +2550,7 @@ var CozyClient = /*#__PURE__*/function () {
2550
2550
  CozyClient.hooks = CozyClient.hooks || {};
2551
2551
  CozyClient.fetchPolicies = _policies.default; //COZY_CLIENT_VERSION_PACKAGE in replaced by babel. See babel config
2552
2552
 
2553
- CozyClient.version = "29.1.2";
2553
+ CozyClient.version = "29.1.3";
2554
2554
 
2555
2555
  _microee.default.mixin(CozyClient);
2556
2556
 
@@ -47,7 +47,7 @@ var checkMeasureParams = function checkMeasureParams(measure) {
47
47
  throw new Error('Date should be in YYYY-MM-DD format');
48
48
  }
49
49
 
50
- if (!value || typeof value !== 'number') {
50
+ if (typeof value !== 'number') {
51
51
  throw new Error('Missing or wrong type parameter: value');
52
52
  }
53
53
 
@@ -28,12 +28,19 @@ describe('dacc', () => {
28
28
  })
29
29
 
30
30
  it('should throw an error when value is missing or malformed', () => {
31
+ const measureNoValue = { ...measure }
32
+ delete measureNoValue.value
33
+ expect(() => checkMeasureParams(measureNoValue)).toThrow()
31
34
  expect(() => checkMeasureParams({ ...measure, value: null })).toThrow()
32
35
  expect(() =>
33
36
  checkMeasureParams({ ...measure, value: 'notacorrectvalue' })
34
37
  ).toThrow()
35
38
  })
36
39
 
40
+ it('should not throw an error when value is 0', () => {
41
+ expect(() => checkMeasureParams({ ...measure, value: 0 })).not.toThrow()
42
+ })
43
+
37
44
  it('should throw an error when measureName is missing or malformed', () => {
38
45
  expect(() =>
39
46
  checkMeasureParams({ ...measure, measureName: null })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-client",
3
- "version": "29.1.2",
3
+ "version": "29.1.3",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.node.js",
6
6
  "browser": "dist/index.js",
@@ -73,5 +73,5 @@
73
73
  "react-native-ios11-devicecheck": "https://github.com/cozy/react-native-devicecheck#app-attest-v0.1"
74
74
  },
75
75
  "sideEffects": false,
76
- "gitHead": "cadb0cef49e5c744190fcf335800211850bc2e97"
76
+ "gitHead": "5471636693d11500031cd1cdb3d7217f5ae9871c"
77
77
  }