rooibos-roku 5.1.0 → 5.2.1
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.
|
@@ -1121,23 +1121,26 @@ namespace rooibos
|
|
|
1121
1121
|
|
|
1122
1122
|
end function
|
|
1123
1123
|
|
|
1124
|
-
function assertClass(value,
|
|
1124
|
+
function assertClass(value, func, msg = "") as dynamic
|
|
1125
1125
|
if m.currentResult.isFail
|
|
1126
1126
|
return false
|
|
1127
1127
|
end if
|
|
1128
|
+
if rooibos.Common.isFunction(func)
|
|
1129
|
+
func = value.toStr().mid(10).replace("_", ".")
|
|
1130
|
+
end if
|
|
1128
1131
|
try
|
|
1129
1132
|
if not Rooibos.Common.isAssociativeArray(value)
|
|
1130
1133
|
if msg = ""
|
|
1131
1134
|
expr_as_string = Rooibos.Common.asString(value)
|
|
1132
|
-
msg = expr_as_string + " was not an aa, so could not match Class " +
|
|
1135
|
+
msg = expr_as_string + " was not an aa, so could not match Class " + func
|
|
1133
1136
|
end if
|
|
1134
1137
|
m.currentResult.fail(msg, m.currentAssertLineNumber)
|
|
1135
1138
|
return false
|
|
1136
1139
|
end if
|
|
1137
1140
|
className = `${value.__classname}`
|
|
1138
|
-
if className <>
|
|
1141
|
+
if className <> func
|
|
1139
1142
|
if msg = ""
|
|
1140
|
-
msg = `Expected class: ${
|
|
1143
|
+
msg = `Expected class: ${func} got ${className}`
|
|
1141
1144
|
end if
|
|
1142
1145
|
m.currentResult.fail(msg, m.currentAssertLineNumber)
|
|
1143
1146
|
return false
|
|
@@ -1619,7 +1622,7 @@ namespace rooibos
|
|
|
1619
1622
|
|
|
1620
1623
|
function _expectCalled(target, methodName, rootObject = invalid as dynamic, fullPath = invalid as dynamic, expectedArgs = invalid, returnValue = invalid as dynamic) as object
|
|
1621
1624
|
try
|
|
1622
|
-
if fullPath <> invalid
|
|
1625
|
+
if type(target) <> "roAssociativeArray" and fullPath <> invalid
|
|
1623
1626
|
target = rooibos.Common.makePathStubbable(rootObject, fullPath)
|
|
1624
1627
|
end if
|
|
1625
1628
|
return m.mock(target, methodName, 1, expectedArgs, returnValue, true)
|
|
@@ -1637,7 +1640,7 @@ namespace rooibos
|
|
|
1637
1640
|
|
|
1638
1641
|
function _stubCall(target, methodName, rootObject = invalid as dynamic, fullPath = invalid as dynamic, returnValue = invalid as dynamic) as object
|
|
1639
1642
|
try
|
|
1640
|
-
if fullPath <> invalid
|
|
1643
|
+
if type(target) <> "roAssociativeArray" and fullPath <> invalid
|
|
1641
1644
|
target = rooibos.Common.makePathStubbable(rootObject, fullPath)
|
|
1642
1645
|
end if
|
|
1643
1646
|
return m.stub(target, methodName, returnValue, true)
|
|
@@ -1656,7 +1659,7 @@ namespace rooibos
|
|
|
1656
1659
|
|
|
1657
1660
|
function _expectNotCalled(target, methodName, rootObject = invalid as dynamic, fullPath = invalid as dynamic) as object
|
|
1658
1661
|
try
|
|
1659
|
-
if fullPath <> invalid
|
|
1662
|
+
if type(target) <> "roAssociativeArray" and fullPath <> invalid
|
|
1660
1663
|
target = rooibos.Common.makePathStubbable(rootObject, fullPath)
|
|
1661
1664
|
end if
|
|
1662
1665
|
return m.mock(target, methodName, 0, invalid, invalid, true)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rooibos-roku",
|
|
3
|
-
"version": "5.1
|
|
3
|
+
"version": "5.2.1",
|
|
4
4
|
"description": "simple, flexible, fun brightscript test framework for roku scenegraph apps - roku brighterscript plugin",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@types/node": "^17.0.29",
|
|
27
27
|
"@typescript-eslint/eslint-plugin": "^4.4.1",
|
|
28
28
|
"@typescript-eslint/parser": "^4.4.1",
|
|
29
|
-
"brighterscript": "^0.
|
|
29
|
+
"brighterscript": "^0.52.1",
|
|
30
30
|
"chai": "^4.2.0",
|
|
31
31
|
"chai-subset": "^1.6.0",
|
|
32
32
|
"coveralls": "^3.0.0",
|
|
@@ -42,9 +42,6 @@
|
|
|
42
42
|
"typescript": "^3.8.3",
|
|
43
43
|
"undent": "^0.1.0"
|
|
44
44
|
},
|
|
45
|
-
"peerDependencies": {
|
|
46
|
-
"brighterscript": "^0.50.1"
|
|
47
|
-
},
|
|
48
45
|
"scripts": {
|
|
49
46
|
"preversion": "npm run build && npm run lint && npm run test",
|
|
50
47
|
"clean": "rm -rf ./dist && mkdir dist",
|