rooibos-roku 5.15.3 → 5.15.5

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.
@@ -242,6 +242,9 @@ namespace rooibos
242
242
  catch error
243
243
  'bs:disable-next-line
244
244
  m.currentResult.crash("test crashed!", error)
245
+ if rooibos.promises.isPromise(test.deferred)
246
+ rooibos.promises.reject(error, test.deferred)
247
+ end if
245
248
  end try
246
249
  else
247
250
  test.run()
@@ -593,7 +596,7 @@ namespace rooibos
593
596
  return false
594
597
  end if
595
598
 
596
- if not aa.DoesExist(key)
599
+ if not aa.ifAssociativeArray.DoesExist(key)
597
600
  if msg = ""
598
601
  actual = rooibos.common.asMultilineString(aa, true)
599
602
  msg = `expected "${rooibos.common.truncateString(actual)}" to have property "${key}"`
@@ -635,7 +638,7 @@ namespace rooibos
635
638
  return false
636
639
  end if
637
640
 
638
- if aa.DoesExist(key)
641
+ if aa.ifAssociativeArray.DoesExist(key)
639
642
  if msg = ""
640
643
  actual = rooibos.common.asMultilineString(aa, true)
641
644
  msg = `expected "${rooibos.common.truncateString(actual)}" to not have property "${key}"`
@@ -688,7 +691,7 @@ namespace rooibos
688
691
  foundKeys = []
689
692
  missingKeys = []
690
693
  for each key in keys
691
- if not aa.DoesExist(key)
694
+ if not aa.ifAssociativeArray.DoesExist(key)
692
695
  missingKeys.push(key)
693
696
  else
694
697
  foundKeys.push(key)
@@ -747,7 +750,7 @@ namespace rooibos
747
750
 
748
751
  foundKeys = []
749
752
  for each key in keys
750
- if aa.DoesExist(key)
753
+ if aa.ifAssociativeArray.DoesExist(key)
751
754
  foundKeys.push(formatJson(key))
752
755
  end if
753
756
  end for
@@ -1121,11 +1124,17 @@ namespace rooibos
1121
1124
  return false
1122
1125
  end if
1123
1126
 
1124
- if array.count() <> count
1127
+ if rooibos.common.isAssociativeArray(array)
1128
+ actualCount = array.ifAssociativeArray.count()
1129
+ else
1130
+ actualCount = array.count()
1131
+ end if
1132
+
1133
+ if actualCount <> count
1125
1134
  if msg = ""
1126
- msg = `expected count "${array.Count()}" to be "${count}"`
1135
+ msg = `expected count "${actualCount}" to be "${count}"`
1127
1136
  end if
1128
- m.currentResult.fail(msg, m.currentAssertLineNumber, rooibos.common.asMultilineString(array.count(), true), rooibos.common.asMultilineString(count, true))
1137
+ m.currentResult.fail(msg, m.currentAssertLineNumber, rooibos.common.asMultilineString(actualCount, true), rooibos.common.asMultilineString(count, true))
1129
1138
  return false
1130
1139
  end if
1131
1140
  return true
@@ -1169,9 +1178,15 @@ namespace rooibos
1169
1178
  return false
1170
1179
  end if
1171
1180
 
1172
- if array.count() = count
1181
+ if rooibos.common.isAssociativeArray(array)
1182
+ actualCount = array.ifAssociativeArray.count()
1183
+ else
1184
+ actualCount = array.count()
1185
+ end if
1186
+
1187
+ if actualCount = count
1173
1188
  if msg = ""
1174
- msg = `expected count "${array.count()}" to not be "${count}"`
1189
+ msg = `expected count "${actualCount}" to not be "${count}"`
1175
1190
  end if
1176
1191
  m.currentResult.fail(msg, m.currentAssertLineNumber)
1177
1192
  return false
@@ -1927,7 +1942,7 @@ namespace rooibos
1927
1942
  end if
1928
1943
  end for
1929
1944
 
1930
- if foundValues.count() <> filteredSubset.count()
1945
+ if foundValues.ifAssociativeArray.count() <> filteredSubset.ifAssociativeArray.count()
1931
1946
  actual = rooibos.common.asMultilineString(foundValues, true)
1932
1947
  expected = rooibos.common.asMultilineString(filteredSubset, true)
1933
1948
  if msg = ""
@@ -1997,7 +2012,7 @@ namespace rooibos
1997
2012
  end if
1998
2013
  end for
1999
2014
 
2000
- if foundValues.count() > 0
2015
+ if foundValues.ifAssociativeArray.count() > 0
2001
2016
  actual = rooibos.common.asMultilineString(foundValues, true)
2002
2017
  expected = rooibos.common.asMultilineString({}, true)
2003
2018
  if msg = ""
@@ -2082,7 +2097,7 @@ namespace rooibos
2082
2097
  end if
2083
2098
  end for
2084
2099
 
2085
- if foundValues.count() <> filteredSubset.count()
2100
+ if foundValues.ifAssociativeArray.count() <> filteredSubset.ifAssociativeArray.count()
2086
2101
  actual = rooibos.common.asMultilineString(foundValues, true)
2087
2102
  expected = rooibos.common.asMultilineString(filteredSubset, true)
2088
2103
  if msg = ""
@@ -2528,7 +2543,7 @@ namespace rooibos
2528
2543
  throw m.errorToThrow
2529
2544
  end if
2530
2545
  'bs:disable-next-line
2531
- if type(m.returnValue) = "roAssociativeArray" and m.returnValue.doesExist("multiResult")
2546
+ if type(m.returnValue) = "roAssociativeArray" and m.returnValue.ifAssociativeArray.doesExist("multiResult")
2532
2547
  'bs:disable-next-line
2533
2548
  returnValues = m.returnValue["multiResult"]
2534
2549
  'bs:disable-next-line
@@ -2561,7 +2576,7 @@ namespace rooibos
2561
2576
  function combineFakes(fake, otherFake)
2562
2577
  'add on the expected invoked args
2563
2578
  lineNumber = m.currentAssertLineNumber
2564
- if type(fake.expectedArgs) <> "roAssociativeArray" or not fake.expectedArgs.doesExist("multiInvoke")
2579
+ if type(fake.expectedArgs) <> "roAssociativeArray" or not fake.expectedArgs.ifAssociativeArray.doesExist("multiInvoke")
2565
2580
  currentExpectedArgsArgs = fake.expectedArgs
2566
2581
  fake.expectedArgs = {
2567
2582
  "multiInvoke": [currentExpectedArgsArgs]
@@ -2572,7 +2587,7 @@ namespace rooibos
2572
2587
  end for
2573
2588
 
2574
2589
  'add on the expected return values
2575
- if type(fake.returnValue) <> "roAssociativeArray" or not fake.returnValue.doesExist("multiResult")
2590
+ if type(fake.returnValue) <> "roAssociativeArray" or not fake.returnValue.ifAssociativeArray.doesExist("multiResult")
2576
2591
  currentReturnValue = fake.returnValue
2577
2592
  fake.returnValue = {
2578
2593
  "multiResult": [currentReturnValue]
@@ -2613,7 +2628,14 @@ namespace rooibos
2613
2628
  else
2614
2629
  expectedArgs = mock.expectedArgs
2615
2630
  end if
2616
- for i = 0 to expectedArgs.count() - 1
2631
+
2632
+ if rooibos.common.isAssociativeArray(expectedArgs)
2633
+ expectedArgsCount = expectedArgs.ifAssociativeArray.count()
2634
+ else
2635
+ expectedArgsCount = expectedArgs.count()
2636
+ end if
2637
+
2638
+ for i = 0 to expectedArgsCount - 1
2617
2639
  value = invokedArgs[i]
2618
2640
  expected = expectedArgs[i]
2619
2641
  didNotExpectArg = rooibos.common.isString(expected) and expected = m.invalidValue
@@ -336,7 +336,7 @@ namespace rooibos.common
336
336
  end if
337
337
 
338
338
  text = "{" + chr(10)
339
- keys = input.keys()
339
+ keys = input.ifAssociativeArray.keys()
340
340
  keys.sort()
341
341
  for each key in keys
342
342
  if rooibos.common.canSafelyIterateAAKey(input, key)
@@ -413,7 +413,7 @@ namespace rooibos.common
413
413
  'bs:disable-next-line
414
414
  isFirst = false
415
415
  end if
416
- keys = input.keys()
416
+ keys = input.ifAssociativeArray.keys()
417
417
  keys.sort()
418
418
  for each key in keys
419
419
  if rooibos.common.canSafelyIterateAAKey(input, key)
@@ -614,7 +614,7 @@ namespace rooibos.common
614
614
  compareValue = array[i]
615
615
 
616
616
  if compareAttribute <> invalid and rooibos.common.isAssociativeArray(compareValue)
617
- compareValue = compareValue.lookupCI(compareAttribute)
617
+ compareValue = compareValue.ifAssociativeArray.lookupCI(compareAttribute)
618
618
  end if
619
619
 
620
620
  if rooibos.common.eqValues(compareValue, value, callCount + 1)
@@ -862,14 +862,14 @@ namespace rooibos.common
862
862
  if not rooibos.common.isAssociativeArray(Value1) or not rooibos.common.isAssociativeArray(Value2)
863
863
  return false
864
864
  end if
865
- l1 = Value1.Count()
866
- l2 = Value2.Count()
865
+ l1 = Value1.ifAssociativeArray.Count()
866
+ l2 = Value2.ifAssociativeArray.Count()
867
867
 
868
868
  if not l1 = l2
869
869
  return false
870
870
  else
871
871
  for each k in Value1
872
- if not Value2.DoesExist(k)
872
+ if not Value2.ifAssociativeArray.DoesExist(k)
873
873
  return false
874
874
  else
875
875
  if rooibos.common.canSafelyIterateAAKey(Value1, k) and rooibos.common.canSafelyIterateAAKey(Value2, k)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rooibos-roku",
3
- "version": "5.15.3",
3
+ "version": "5.15.5",
4
4
  "description": "simple, flexible, fun brightscript test framework for roku scenegraph apps - roku brighterscript plugin",
5
5
  "scripts": {
6
6
  "preversion": "npm run build && npm run lint && npm run test",