rooibos-roku 4.6.1 → 4.8.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.
- package/dist/lib/framework/BaseTestSuite.bs +197 -5
- package/dist/lib/framework/TestRunner.bs +5 -0
- package/dist/lib/rooibos/TestGroup.js +68 -12
- package/dist/lib/rooibos/TestGroup.js.map +1 -1
- package/dist/lib/rooibos/Utils.js +1 -27
- package/dist/lib/rooibos/Utils.js.map +1 -1
- package/package.json +20 -18
|
@@ -1576,8 +1576,9 @@ namespace rooibos
|
|
|
1576
1576
|
end if
|
|
1577
1577
|
m.__stubId++
|
|
1578
1578
|
|
|
1579
|
-
if m.__stubId >
|
|
1580
|
-
? "ERROR ONLY
|
|
1579
|
+
if m.__stubId > 25
|
|
1580
|
+
? "ERROR ONLY 25 MOCKS PER TEST ARE SUPPORTED!! you're on # " ; m.__mockId
|
|
1581
|
+
? " Method was " ; methodName
|
|
1581
1582
|
return invalid
|
|
1582
1583
|
end if
|
|
1583
1584
|
|
|
@@ -1591,9 +1592,10 @@ namespace rooibos
|
|
|
1591
1592
|
target[methodName] = m["StubCallback" + id]
|
|
1592
1593
|
target.__stubs = m.stubs
|
|
1593
1594
|
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1595
|
+
' FIXME: add a log setting for this - and add better detection so that stubs know that they are colliding/don't exist/have correct sigs
|
|
1596
|
+
' if not isMethodPresent
|
|
1597
|
+
' ? "WARNING - stubbing call " ; methodName; " which did not exist on target object"
|
|
1598
|
+
' end if
|
|
1597
1599
|
else
|
|
1598
1600
|
? "ERROR - could not create Stub : method not found "; target ; "." ; methodName
|
|
1599
1601
|
end if
|
|
@@ -1601,6 +1603,67 @@ namespace rooibos
|
|
|
1601
1603
|
return fake
|
|
1602
1604
|
end function
|
|
1603
1605
|
|
|
1606
|
+
function expectLastCallToThrowError(error as dynamic)
|
|
1607
|
+
try
|
|
1608
|
+
mock = m.mocks[m.__mockId.toStr()]
|
|
1609
|
+
mock.toThrow(error)
|
|
1610
|
+
catch error
|
|
1611
|
+
m.log.error("could not add throw to last call", error)
|
|
1612
|
+
end try
|
|
1613
|
+
end function
|
|
1614
|
+
|
|
1615
|
+
function expectCalled(invocation as dynamic, returnValue = invalid as dynamic, thrownError = invalid as dynamic) as object
|
|
1616
|
+
'mock function body - the plugin replaces this
|
|
1617
|
+
return invalid
|
|
1618
|
+
end function
|
|
1619
|
+
|
|
1620
|
+
function _expectCalled(target, methodName, expectedArgs = invalid, returnValue = invalid as dynamic, thrownError = invalid as dynamic) as object
|
|
1621
|
+
try
|
|
1622
|
+
mock = m.mock(target, methodName, 1, expectedArgs, returnValue, true)
|
|
1623
|
+
if thrownError <> invalid
|
|
1624
|
+
mock.toThrow(thrownError)
|
|
1625
|
+
end if
|
|
1626
|
+
catch error
|
|
1627
|
+
'bs:disable-next-line
|
|
1628
|
+
m.currentResult.fail("Setting up mock failed: " + error.message, m.currentAssertLineNumber)
|
|
1629
|
+
return false
|
|
1630
|
+
end try
|
|
1631
|
+
return false
|
|
1632
|
+
end function
|
|
1633
|
+
|
|
1634
|
+
function stubCall(invocation as dynamic, returnValue = invalid as dynamic) as object
|
|
1635
|
+
'mock function body - the plugin replaces this
|
|
1636
|
+
return invalid
|
|
1637
|
+
end function
|
|
1638
|
+
|
|
1639
|
+
function _stubCall(target, methodName, returnValue = invalid as dynamic) as object
|
|
1640
|
+
try
|
|
1641
|
+
return m.stub(target, methodName, returnValue, true)
|
|
1642
|
+
catch error
|
|
1643
|
+
'bs:disable-next-line
|
|
1644
|
+
m.currentResult.fail("Setting up mock failed: " + error.message, m.currentAssertLineNumber)
|
|
1645
|
+
return false
|
|
1646
|
+
end try
|
|
1647
|
+
return false
|
|
1648
|
+
end function
|
|
1649
|
+
|
|
1650
|
+
function expectNotCalled(invocation as dynamic) as object
|
|
1651
|
+
'mock function body - the plugin replaces this
|
|
1652
|
+
return invalid
|
|
1653
|
+
end function
|
|
1654
|
+
|
|
1655
|
+
function _expectNotCalled(target, methodName) as object
|
|
1656
|
+
try
|
|
1657
|
+
return m.mock(target, methodName, 0, invalid, invalid, true)
|
|
1658
|
+
catch error
|
|
1659
|
+
'bs:disable-next-line
|
|
1660
|
+
m.currentResult.fail("Setting up mock failed: " + error.message, m.currentAssertLineNumber)
|
|
1661
|
+
return false
|
|
1662
|
+
end try
|
|
1663
|
+
return false
|
|
1664
|
+
end function
|
|
1665
|
+
|
|
1666
|
+
|
|
1604
1667
|
' /**
|
|
1605
1668
|
' * @memberof module:BaseTestSuite
|
|
1606
1669
|
' * @name expectOnce
|
|
@@ -1833,9 +1896,11 @@ namespace rooibos
|
|
|
1833
1896
|
expectedArgsValues.push(defaultValue)
|
|
1834
1897
|
end if
|
|
1835
1898
|
end for
|
|
1899
|
+
'todo - make into a class
|
|
1836
1900
|
fake = {
|
|
1837
1901
|
id: id,
|
|
1838
1902
|
target: target,
|
|
1903
|
+
errorToThrow: invalid,
|
|
1839
1904
|
methodName: methodName,
|
|
1840
1905
|
returnValue: returnValue,
|
|
1841
1906
|
lineNumbers: lineNumbers,
|
|
@@ -1860,6 +1925,9 @@ namespace rooibos
|
|
|
1860
1925
|
'bs:disable-next-line
|
|
1861
1926
|
m.invocations++
|
|
1862
1927
|
|
|
1928
|
+
if m.errorToThrow <> invalid
|
|
1929
|
+
throw m.errorToThrow
|
|
1930
|
+
end if
|
|
1863
1931
|
'bs:disable-next-line
|
|
1864
1932
|
if type(m.returnValue) = "roAssociativeArray" and m.returnValue.doesExist("multiResult")
|
|
1865
1933
|
'bs:disable-next-line
|
|
@@ -1884,6 +1952,9 @@ namespace rooibos
|
|
|
1884
1952
|
return m.returnValue
|
|
1885
1953
|
end if
|
|
1886
1954
|
end function
|
|
1955
|
+
toThrow: function(error)
|
|
1956
|
+
m.errorToThrow = error
|
|
1957
|
+
end function
|
|
1887
1958
|
}
|
|
1888
1959
|
return fake
|
|
1889
1960
|
end function
|
|
@@ -2062,6 +2133,127 @@ namespace rooibos
|
|
|
2062
2133
|
return fake.callback(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15)
|
|
2063
2134
|
end function
|
|
2064
2135
|
|
|
2136
|
+
function stubCallback6(arg1 = invalid, arg2 = invalid, arg3 = invalid, arg4 = invalid, arg5 = invalid, arg6 = invalid, arg7 = invalid, arg8 = invalid, arg9 = invalid, arg10 = invalid, arg11 = invalid, arg12 = invalid, arg13 = invalid, arg14 = invalid, arg15 = invalid) as dynamic
|
|
2137
|
+
'bs:disable-next-line
|
|
2138
|
+
fake = m.__Stubs["6"]
|
|
2139
|
+
return fake.callback(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15)
|
|
2140
|
+
end function
|
|
2141
|
+
|
|
2142
|
+
function stubCallback7(arg1 = invalid, arg2 = invalid, arg3 = invalid, arg4 = invalid, arg5 = invalid, arg6 = invalid, arg7 = invalid, arg8 = invalid, arg9 = invalid, arg10 = invalid, arg11 = invalid, arg12 = invalid, arg13 = invalid, arg14 = invalid, arg15 = invalid) as dynamic
|
|
2143
|
+
'bs:disable-next-line
|
|
2144
|
+
fake = m.__Stubs["7"]
|
|
2145
|
+
return fake.callback(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15)
|
|
2146
|
+
end function
|
|
2147
|
+
|
|
2148
|
+
function stubCallback8(arg1 = invalid, arg2 = invalid, arg3 = invalid, arg4 = invalid, arg5 = invalid, arg6 = invalid, arg7 = invalid, arg8 = invalid, arg9 = invalid, arg10 = invalid, arg11 = invalid, arg12 = invalid, arg13 = invalid, arg14 = invalid, arg15 = invalid) as dynamic
|
|
2149
|
+
'bs:disable-next-line
|
|
2150
|
+
fake = m.__Stubs["8"]
|
|
2151
|
+
return fake.callback(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15)
|
|
2152
|
+
end function
|
|
2153
|
+
|
|
2154
|
+
function stubCallback9(arg1 = invalid, arg2 = invalid, arg3 = invalid, arg4 = invalid, arg5 = invalid, arg6 = invalid, arg7 = invalid, arg8 = invalid, arg9 = invalid, arg10 = invalid, arg11 = invalid, arg12 = invalid, arg13 = invalid, arg14 = invalid, arg15 = invalid) as dynamic
|
|
2155
|
+
'bs:disable-next-line
|
|
2156
|
+
fake = m.__Stubs["9"]
|
|
2157
|
+
return fake.callback(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15)
|
|
2158
|
+
end function
|
|
2159
|
+
|
|
2160
|
+
function stubCallback10(arg1 = invalid, arg2 = invalid, arg3 = invalid, arg4 = invalid, arg5 = invalid, arg6 = invalid, arg7 = invalid, arg8 = invalid, arg9 = invalid, arg10 = invalid, arg11 = invalid, arg12 = invalid, arg13 = invalid, arg14 = invalid, arg15 = invalid) as dynamic
|
|
2161
|
+
'bs:disable-next-line
|
|
2162
|
+
fake = m.__Stubs["10"]
|
|
2163
|
+
return fake.callback(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15)
|
|
2164
|
+
end function
|
|
2165
|
+
|
|
2166
|
+
function stubCallback11(arg1 = invalid, arg2 = invalid, arg3 = invalid, arg4 = invalid, arg5 = invalid, arg6 = invalid, arg7 = invalid, arg8 = invalid, arg9 = invalid, arg10 = invalid, arg11 = invalid, arg12 = invalid, arg13 = invalid, arg14 = invalid, arg15 = invalid) as dynamic
|
|
2167
|
+
'bs:disable-next-line
|
|
2168
|
+
fake = m.__Stubs["11"]
|
|
2169
|
+
return fake.callback(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15)
|
|
2170
|
+
end function
|
|
2171
|
+
|
|
2172
|
+
function stubCallback12(arg1 = invalid, arg2 = invalid, arg3 = invalid, arg4 = invalid, arg5 = invalid, arg6 = invalid, arg7 = invalid, arg8 = invalid, arg9 = invalid, arg10 = invalid, arg11 = invalid, arg12 = invalid, arg13 = invalid, arg14 = invalid, arg15 = invalid) as dynamic
|
|
2173
|
+
'bs:disable-next-line
|
|
2174
|
+
fake = m.__Stubs["12"]
|
|
2175
|
+
return fake.callback(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15)
|
|
2176
|
+
end function
|
|
2177
|
+
|
|
2178
|
+
function stubCallback13(arg1 = invalid, arg2 = invalid, arg3 = invalid, arg4 = invalid, arg5 = invalid, arg6 = invalid, arg7 = invalid, arg8 = invalid, arg9 = invalid, arg10 = invalid, arg11 = invalid, arg12 = invalid, arg13 = invalid, arg14 = invalid, arg15 = invalid) as dynamic
|
|
2179
|
+
'bs:disable-next-line
|
|
2180
|
+
fake = m.__Stubs["13"]
|
|
2181
|
+
return fake.callback(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15)
|
|
2182
|
+
end function
|
|
2183
|
+
|
|
2184
|
+
function stubCallback14(arg1 = invalid, arg2 = invalid, arg3 = invalid, arg4 = invalid, arg5 = invalid, arg6 = invalid, arg7 = invalid, arg8 = invalid, arg9 = invalid, arg10 = invalid, arg11 = invalid, arg12 = invalid, arg13 = invalid, arg14 = invalid, arg15 = invalid) as dynamic
|
|
2185
|
+
'bs:disable-next-line
|
|
2186
|
+
fake = m.__Stubs["14"]
|
|
2187
|
+
return fake.callback(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15)
|
|
2188
|
+
end function
|
|
2189
|
+
|
|
2190
|
+
function stubCallback15(arg1 = invalid, arg2 = invalid, arg3 = invalid, arg4 = invalid, arg5 = invalid, arg6 = invalid, arg7 = invalid, arg8 = invalid, arg9 = invalid, arg10 = invalid, arg11 = invalid, arg12 = invalid, arg13 = invalid, arg14 = invalid, arg15 = invalid) as dynamic
|
|
2191
|
+
'bs:disable-next-line
|
|
2192
|
+
fake = m.__Stubs["15"]
|
|
2193
|
+
return fake.callback(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15)
|
|
2194
|
+
end function
|
|
2195
|
+
|
|
2196
|
+
function stubCallback16(arg1 = invalid, arg2 = invalid, arg3 = invalid, arg4 = invalid, arg5 = invalid, arg6 = invalid, arg7 = invalid, arg8 = invalid, arg9 = invalid, arg10 = invalid, arg11 = invalid, arg12 = invalid, arg13 = invalid, arg14 = invalid, arg15 = invalid) as dynamic
|
|
2197
|
+
'bs:disable-next-line
|
|
2198
|
+
fake = m.__Stubs["16"]
|
|
2199
|
+
return fake.callback(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15)
|
|
2200
|
+
end function
|
|
2201
|
+
|
|
2202
|
+
function stubCallback17(arg1 = invalid, arg2 = invalid, arg3 = invalid, arg4 = invalid, arg5 = invalid, arg6 = invalid, arg7 = invalid, arg8 = invalid, arg9 = invalid, arg10 = invalid, arg11 = invalid, arg12 = invalid, arg13 = invalid, arg14 = invalid, arg15 = invalid) as dynamic
|
|
2203
|
+
'bs:disable-next-line
|
|
2204
|
+
fake = m.__Stubs["17"]
|
|
2205
|
+
return fake.callback(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15)
|
|
2206
|
+
end function
|
|
2207
|
+
|
|
2208
|
+
function stubCallback18(arg1 = invalid, arg2 = invalid, arg3 = invalid, arg4 = invalid, arg5 = invalid, arg6 = invalid, arg7 = invalid, arg8 = invalid, arg9 = invalid, arg10 = invalid, arg11 = invalid, arg12 = invalid, arg13 = invalid, arg14 = invalid, arg15 = invalid) as dynamic
|
|
2209
|
+
'bs:disable-next-line
|
|
2210
|
+
fake = m.__Stubs["18"]
|
|
2211
|
+
return fake.callback(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15)
|
|
2212
|
+
end function
|
|
2213
|
+
|
|
2214
|
+
function stubCallback19(arg1 = invalid, arg2 = invalid, arg3 = invalid, arg4 = invalid, arg5 = invalid, arg6 = invalid, arg7 = invalid, arg8 = invalid, arg9 = invalid, arg10 = invalid, arg11 = invalid, arg12 = invalid, arg13 = invalid, arg14 = invalid, arg15 = invalid) as dynamic
|
|
2215
|
+
'bs:disable-next-line
|
|
2216
|
+
fake = m.__Stubs["19"]
|
|
2217
|
+
return fake.callback(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15)
|
|
2218
|
+
end function
|
|
2219
|
+
|
|
2220
|
+
function stubCallback20(arg1 = invalid, arg2 = invalid, arg3 = invalid, arg4 = invalid, arg5 = invalid, arg6 = invalid, arg7 = invalid, arg8 = invalid, arg9 = invalid, arg10 = invalid, arg11 = invalid, arg12 = invalid, arg13 = invalid, arg14 = invalid, arg15 = invalid) as dynamic
|
|
2221
|
+
'bs:disable-next-line
|
|
2222
|
+
fake = m.__Stubs["20"]
|
|
2223
|
+
return fake.callback(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15)
|
|
2224
|
+
end function
|
|
2225
|
+
|
|
2226
|
+
function stubCallback21(arg1 = invalid, arg2 = invalid, arg3 = invalid, arg4 = invalid, arg5 = invalid, arg6 = invalid, arg7 = invalid, arg8 = invalid, arg9 = invalid, arg10 = invalid, arg11 = invalid, arg12 = invalid, arg13 = invalid, arg14 = invalid, arg15 = invalid) as dynamic
|
|
2227
|
+
'bs:disable-next-line
|
|
2228
|
+
fake = m.__Stubs["21"]
|
|
2229
|
+
return fake.callback(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15)
|
|
2230
|
+
end function
|
|
2231
|
+
|
|
2232
|
+
function stubCallback22(arg1 = invalid, arg2 = invalid, arg3 = invalid, arg4 = invalid, arg5 = invalid, arg6 = invalid, arg7 = invalid, arg8 = invalid, arg9 = invalid, arg10 = invalid, arg11 = invalid, arg12 = invalid, arg13 = invalid, arg14 = invalid, arg15 = invalid) as dynamic
|
|
2233
|
+
'bs:disable-next-line
|
|
2234
|
+
fake = m.__Stubs["22"]
|
|
2235
|
+
return fake.callback(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15)
|
|
2236
|
+
end function
|
|
2237
|
+
|
|
2238
|
+
function stubCallback23(arg1 = invalid, arg2 = invalid, arg3 = invalid, arg4 = invalid, arg5 = invalid, arg6 = invalid, arg7 = invalid, arg8 = invalid, arg9 = invalid, arg10 = invalid, arg11 = invalid, arg12 = invalid, arg13 = invalid, arg14 = invalid, arg15 = invalid) as dynamic
|
|
2239
|
+
'bs:disable-next-line
|
|
2240
|
+
fake = m.__Stubs["23"]
|
|
2241
|
+
return fake.callback(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15)
|
|
2242
|
+
end function
|
|
2243
|
+
|
|
2244
|
+
function stubCallback24(arg1 = invalid, arg2 = invalid, arg3 = invalid, arg4 = invalid, arg5 = invalid, arg6 = invalid, arg7 = invalid, arg8 = invalid, arg9 = invalid, arg10 = invalid, arg11 = invalid, arg12 = invalid, arg13 = invalid, arg14 = invalid, arg15 = invalid) as dynamic
|
|
2245
|
+
'bs:disable-next-line
|
|
2246
|
+
fake = m.__Stubs["24"]
|
|
2247
|
+
return fake.callback(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15)
|
|
2248
|
+
end function
|
|
2249
|
+
|
|
2250
|
+
function stubCallback25(arg1 = invalid, arg2 = invalid, arg3 = invalid, arg4 = invalid, arg5 = invalid, arg6 = invalid, arg7 = invalid, arg8 = invalid, arg9 = invalid, arg10 = invalid, arg11 = invalid, arg12 = invalid, arg13 = invalid, arg14 = invalid, arg15 = invalid) as dynamic
|
|
2251
|
+
'bs:disable-next-line
|
|
2252
|
+
fake = m.__Stubs["25"]
|
|
2253
|
+
return fake.callback(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15)
|
|
2254
|
+
end function
|
|
2255
|
+
|
|
2256
|
+
|
|
2065
2257
|
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
2066
2258
|
'++ Fake Mock callback functions - this is required to get scope
|
|
2067
2259
|
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
@@ -51,6 +51,7 @@ namespace rooibos
|
|
|
51
51
|
failedText = ""
|
|
52
52
|
i = 0
|
|
53
53
|
numSuites = suiteNames.count()
|
|
54
|
+
testSuite = invalid
|
|
54
55
|
for each name in suiteNames
|
|
55
56
|
i++
|
|
56
57
|
'bs:disable-next-line
|
|
@@ -90,6 +91,10 @@ namespace rooibos
|
|
|
90
91
|
testSuite.scene.statusColor = "#238636"
|
|
91
92
|
end if
|
|
92
93
|
|
|
94
|
+
if testSuite = invalid
|
|
95
|
+
m.nodeContext.global.testsScene.failedText = "No tests were found"
|
|
96
|
+
end if
|
|
97
|
+
|
|
93
98
|
m.stats.time = timer.totalMilliseconds()
|
|
94
99
|
|
|
95
100
|
m.testReporter.reportResults(m.stats)
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TestGroup = void 0;
|
|
4
4
|
const brighterscript_1 = require("brighterscript");
|
|
5
|
+
const brighterscript = require("brighterscript");
|
|
5
6
|
const BrsTranspileState_1 = require("brighterscript/dist/parser/BrsTranspileState");
|
|
6
7
|
const Diagnostics_1 = require("../utils/Diagnostics");
|
|
7
8
|
const RawCodeStatement_1 = require("./RawCodeStatement");
|
|
@@ -41,23 +42,32 @@ class TestGroup extends TestSuite_1.TestBlock {
|
|
|
41
42
|
const transpileState = new BrsTranspileState_1.BrsTranspileState(this.file);
|
|
42
43
|
try {
|
|
43
44
|
let func = this.testSuite.classStatement.methods.find((m) => m.name.text.toLowerCase() === testCase.funcName.toLowerCase());
|
|
44
|
-
func.walk(
|
|
45
|
-
ExpressionStatement: (
|
|
46
|
-
let
|
|
47
|
-
if (
|
|
48
|
-
let dge =
|
|
49
|
-
let assertRegex = /(?:fail|assert(?:[a-z0-9]*)|expect(?:[a-z0-9]*))/i;
|
|
45
|
+
func.walk(brighterscript.createVisitor({
|
|
46
|
+
ExpressionStatement: (expressionStatement) => {
|
|
47
|
+
let callExpression = expressionStatement.expression;
|
|
48
|
+
if (brighterscript.isCallExpression(callExpression) && brighterscript.isDottedGetExpression(callExpression.callee)) {
|
|
49
|
+
let dge = callExpression.callee;
|
|
50
|
+
let assertRegex = /(?:fail|assert(?:[a-z0-9]*)|expect(?:[a-z0-9]*)|stubCall)/i;
|
|
50
51
|
if (dge && assertRegex.test(dge.name.text)) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
if (dge.name.text === 'stubCall') {
|
|
53
|
+
this.modifyModernRooibosExpectCallExpression(callExpression);
|
|
54
|
+
return expressionStatement;
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
if (dge.name.text === 'expectCalled' || dge.name.text === 'expectNotCalled') {
|
|
58
|
+
this.modifyModernRooibosExpectCallExpression(callExpression);
|
|
59
|
+
}
|
|
60
|
+
return new RawCodeStatement_1.RawCodeStatement(`
|
|
61
|
+
m.currentAssertLineNumber = ${callExpression.range.start.line}
|
|
62
|
+
${callExpression.transpile(transpileState).join('')}
|
|
63
|
+
${noEarlyExit ? '' : 'if m.currentResult.isFail then return invalid'}
|
|
64
|
+
`, this.file, callExpression.range);
|
|
65
|
+
}
|
|
56
66
|
}
|
|
57
67
|
}
|
|
58
68
|
}
|
|
59
69
|
}), {
|
|
60
|
-
walkMode:
|
|
70
|
+
walkMode: brighterscript.WalkMode.visitStatementsRecursive
|
|
61
71
|
});
|
|
62
72
|
}
|
|
63
73
|
catch (e) {
|
|
@@ -65,6 +75,52 @@ class TestGroup extends TestSuite_1.TestBlock {
|
|
|
65
75
|
Diagnostics_1.diagnosticErrorProcessingFile(this.testSuite.file, e.message);
|
|
66
76
|
}
|
|
67
77
|
}
|
|
78
|
+
modifyModernRooibosExpectCallExpression(callExpression) {
|
|
79
|
+
let isNotCalled = false;
|
|
80
|
+
let isStubCall = false;
|
|
81
|
+
if (brighterscript_1.isDottedGetExpression(callExpression.callee)) {
|
|
82
|
+
const nameText = callExpression.callee.name.text;
|
|
83
|
+
callExpression.callee.name.text = `_${nameText}`;
|
|
84
|
+
isNotCalled = nameText === 'expectNotCalled';
|
|
85
|
+
isStubCall = nameText === 'stubCall';
|
|
86
|
+
}
|
|
87
|
+
//modify args
|
|
88
|
+
let arg0 = callExpression.args[0];
|
|
89
|
+
if (brighterscript.isCallExpression(arg0) && brighterscript_1.isDottedGetExpression(arg0.callee)) {
|
|
90
|
+
let functionName = arg0.callee.name.text;
|
|
91
|
+
callExpression.args.shift();
|
|
92
|
+
if (!isNotCalled && !isStubCall) {
|
|
93
|
+
const expectedArgs = new brighterscript_1.ArrayLiteralExpression(arg0.args, brighterscript_1.createToken(brighterscript_1.TokenKind.LeftSquareBracket), brighterscript_1.createToken(brighterscript_1.TokenKind.RightSquareBracket));
|
|
94
|
+
callExpression.args.unshift(expectedArgs);
|
|
95
|
+
}
|
|
96
|
+
callExpression.args.unshift(brighterscript_1.createStringLiteral(functionName));
|
|
97
|
+
callExpression.args.unshift(arg0.callee.obj);
|
|
98
|
+
}
|
|
99
|
+
else if (brighterscript.isDottedGetExpression(arg0)) {
|
|
100
|
+
let functionName = arg0.name.text;
|
|
101
|
+
arg0 = callExpression.args.shift();
|
|
102
|
+
if (!isNotCalled && !isStubCall) {
|
|
103
|
+
callExpression.args.unshift(brighterscript_1.createInvalidLiteral());
|
|
104
|
+
}
|
|
105
|
+
callExpression.args.unshift(brighterscript_1.createStringLiteral(functionName));
|
|
106
|
+
callExpression.args.unshift(arg0.obj);
|
|
107
|
+
}
|
|
108
|
+
else if (brighterscript.isCallfuncExpression(arg0)) {
|
|
109
|
+
let functionName = arg0.methodName.text;
|
|
110
|
+
callExpression.args.shift();
|
|
111
|
+
if (isNotCalled || isStubCall) {
|
|
112
|
+
//TODO in future we can improve is notCalled to know which callFunc function it is
|
|
113
|
+
// const expectedArgs = new ArrayLiteralExpression([createStringLiteral(functionName)], createToken(TokenKind.LeftSquareBracket), createToken(TokenKind.RightSquareBracket));
|
|
114
|
+
// callExpression.args.unshift(expectedArgs);
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
const expectedArgs = new brighterscript_1.ArrayLiteralExpression([brighterscript_1.createStringLiteral(functionName), ...arg0.args], brighterscript_1.createToken(brighterscript_1.TokenKind.LeftSquareBracket), brighterscript_1.createToken(brighterscript_1.TokenKind.RightSquareBracket));
|
|
118
|
+
callExpression.args.unshift(expectedArgs);
|
|
119
|
+
}
|
|
120
|
+
callExpression.args.unshift(brighterscript_1.createStringLiteral('callFunc'));
|
|
121
|
+
callExpression.args.unshift(arg0.callee);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
68
124
|
asText() {
|
|
69
125
|
let testCaseText = [...this.testCases.values()].filter((tc) => tc.isIncluded).map((tc) => tc.asText());
|
|
70
126
|
return `
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestGroup.js","sourceRoot":"","sources":["../../../src/lib/rooibos/TestGroup.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"TestGroup.js","sourceRoot":"","sources":["../../../src/lib/rooibos/TestGroup.ts"],"names":[],"mappings":";;;AACA,mDAAkJ;AAClJ,iDAAiD;AACjD,oFAAiF;AAEjF,sDAAqE;AAErE,yDAAsD;AAGtD,2CAAwC;AACxC,mCAA+C;AAE/C,MAAa,SAAU,SAAQ,qBA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exports.
|
|
3
|
+
exports.getTokenText = exports.createVarExpression = exports.createIfStatement = exports.sanitizeBsJsonString = exports.changeClassMethodBody = exports.addOverriddenMethod = exports.changeFunctionBody = exports.getFunctionBody = exports.makeASTFunction = exports.pad = exports.addSetItems = exports.getRegexMatchValue = exports.getRegexMatchesValues = exports.spliceString = void 0;
|
|
4
4
|
const brighterscript_1 = require("brighterscript");
|
|
5
5
|
const brighterscript = require("brighterscript");
|
|
6
|
-
const rokuDeploy = require("roku-deploy");
|
|
7
6
|
const Diagnostics_1 = require("../utils/Diagnostics");
|
|
8
7
|
function spliceString(str, index, count, add) {
|
|
9
8
|
// We cannot pass negative indexes directly to the 2nd slicing operation.
|
|
@@ -146,29 +145,4 @@ function getTokenText(operator) {
|
|
|
146
145
|
}
|
|
147
146
|
}
|
|
148
147
|
exports.getTokenText = getTokenText;
|
|
149
|
-
/**
|
|
150
|
-
* A tagged template literal function for standardizing the path. This has to be defined as standalone function since it's a tagged template literal function,
|
|
151
|
-
* we can't use `object.tag` syntax.
|
|
152
|
-
*/
|
|
153
|
-
function standardizePath(stringParts, ...expressions) {
|
|
154
|
-
let result = [];
|
|
155
|
-
for (let i = 0; i < stringParts.length; i++) {
|
|
156
|
-
result.push(stringParts[i], expressions[i]);
|
|
157
|
-
}
|
|
158
|
-
return driveLetterToLower(rokuDeploy.standardizePath(result.join('')));
|
|
159
|
-
}
|
|
160
|
-
exports.standardizePath = standardizePath;
|
|
161
|
-
function driveLetterToLower(fullPath) {
|
|
162
|
-
if (fullPath) {
|
|
163
|
-
let firstCharCode = fullPath.charCodeAt(0);
|
|
164
|
-
if (
|
|
165
|
-
//is upper case A-Z
|
|
166
|
-
firstCharCode >= 65 && firstCharCode <= 90 &&
|
|
167
|
-
//next char is colon
|
|
168
|
-
fullPath[1] === ':') {
|
|
169
|
-
fullPath = fullPath[0].toLowerCase() + fullPath.substring(1);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
return fullPath;
|
|
173
|
-
}
|
|
174
148
|
//# sourceMappingURL=Utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Utils.js","sourceRoot":"","sources":["../../../src/lib/rooibos/Utils.ts"],"names":[],"mappings":";;;AACA,mDAA0D;AAC1D,iDAAiD;
|
|
1
|
+
{"version":3,"file":"Utils.js","sourceRoot":"","sources":["../../../src/lib/rooibos/Utils.ts"],"names":[],"mappings":";;;AACA,mDAA0D;AAC1D,iDAAiD;AACjD,sDAAqE;AAErE,SAAgB,YAAY,CAAC,GAAW,EAAE,KAAa,EAAE,KAAa,EAAE,GAAW;IAC/E,yEAAyE;IACzE,IAAI,KAAK,GAAG,CAAC,EAAE;QACX,KAAK,GAAG,GAAG,CAAC,MAAM,GAAG,KAAK,CAAC;QAC3B,IAAI,KAAK,GAAG,CAAC,EAAE;YACX,KAAK,GAAG,CAAC,CAAC;SACb;KACJ;IAED,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,EAAE,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC;AACxE,CAAC;AAVD,oCAUC;AAED,SAAgB,qBAAqB,CAAC,KAAK,EAAE,KAAK,EAAE,UAAU;IAC1D,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,IAAI,OAAc,CAAC;IACnB,2BAA2B;IAC3B,OAAO,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;QAChC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;KACpC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC;AARD,sDAQC;AACD,SAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,EAAE,UAAU;IACvD,IAAI,OAAc,CAAC;IACnB,2BAA2B;IAC3B,OAAO,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;QAChC,IAAI,OAAO,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C;IAEhG,IAAI,CAAC,GAAG,cAAc,CAAC,WAAW,CAAC,QAAQ,EAAE,YAAY,CAAC,QAAQ,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACnH,OAAO,IAAI,cAAc,CAAC,gBAAgB,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAC/D,CAAC;AAND,kDAMC;AAED,SAAgB,YAAY,CAAC,QAAkC;IAC3D,QAAQ,QAAQ,EAAE;QACd,KAAK,cAAc,CAAC,SAAS,CAAC,KAAK;YAC/B,OAAO,GAAG,CAAC;QACf,KAAK,cAAc,CAAC,SAAS,CAAC,IAAI;YAC9B,OAAO,GAAG,CAAC;QACf,KAAK,cAAc,CAAC,SAAS,CAAC,KAAK;YAC/B,OAAO,GAAG,CAAC;QACf,KAAK,cAAc,CAAC,SAAS,CAAC,IAAI;YAC9B,OAAO,GAAG,CAAC;QACf,KAAK,cAAc,CAAC,SAAS,CAAC,OAAO;YACjC,OAAO,GAAG,CAAC;QACf;YACI,OAAO,EAAE,CAAC;KACjB;AACL,CAAC;AAfD,oCAeC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rooibos-roku",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.8.1",
|
|
4
4
|
"description": "simple, flexible, fun brightscript test framework for roku scenegraph apps - roku brighterscript plugin",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -14,49 +14,47 @@
|
|
|
14
14
|
"test": "test"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@types/node": "^14.14.16",
|
|
18
17
|
"source-map": "^0.7.3",
|
|
19
|
-
"stringify-object": "^3.3.0",
|
|
20
18
|
"vscode-languageserver": "~6.1.1",
|
|
21
19
|
"vscode-languageserver-protocol": "~3.15.3"
|
|
22
20
|
},
|
|
23
21
|
"devDependencies": {
|
|
24
22
|
"@types/chai": "^4.1.2",
|
|
25
|
-
"@types/
|
|
23
|
+
"@types/events": "^3.0.0",
|
|
26
24
|
"@types/fs-extra": "^5.0.1",
|
|
27
|
-
"@types/mocha": "^
|
|
28
|
-
"@types/
|
|
25
|
+
"@types/mocha": "^9.1.1",
|
|
26
|
+
"@types/node": "^17.0.29",
|
|
29
27
|
"@typescript-eslint/eslint-plugin": "^4.4.1",
|
|
30
28
|
"@typescript-eslint/parser": "^4.4.1",
|
|
31
|
-
"brighterscript": "0.
|
|
29
|
+
"brighterscript": "0.49.0",
|
|
32
30
|
"chai": "^4.2.0",
|
|
33
|
-
"chai-files": "^1.4.0",
|
|
34
31
|
"chai-subset": "^1.6.0",
|
|
35
|
-
"
|
|
36
|
-
"eslint
|
|
37
|
-
"eslint-plugin-no-only-tests": "2.
|
|
32
|
+
"coveralls": "^3.0.0",
|
|
33
|
+
"eslint": "^7.11.0",
|
|
34
|
+
"eslint-plugin-no-only-tests": "^2.4.0",
|
|
35
|
+
"fs-extra": "^10.1.0",
|
|
38
36
|
"minimatch": "^3.0.4",
|
|
39
|
-
"mocha": "^
|
|
37
|
+
"mocha": "^9.2.2",
|
|
40
38
|
"nyc": "^15.1.0",
|
|
41
|
-
"roku-deploy": "^3.2.4",
|
|
42
|
-
"sinon": "^9.0.2",
|
|
43
39
|
"source-map-support": "^0.5.13",
|
|
44
40
|
"trim-whitespace": "^1.3.3",
|
|
45
41
|
"ts-node": "^9.0.0",
|
|
46
42
|
"typescript": "^3.8.3",
|
|
47
|
-
"
|
|
43
|
+
"undent": "^0.1.0"
|
|
48
44
|
},
|
|
49
45
|
"peerDependencies": {
|
|
50
46
|
"brighterscript": "^0.45.3"
|
|
51
47
|
},
|
|
52
48
|
"scripts": {
|
|
49
|
+
"preversion": "npm run build && npm run lint && npm run test",
|
|
53
50
|
"clean": "rm -rf ./dist && mkdir dist",
|
|
54
51
|
"compile": "npm run clean && tsc -p .",
|
|
55
52
|
"prepublishOnly": "npm run build",
|
|
56
53
|
"lint": "eslint \"src/**\"",
|
|
57
54
|
"build": "npm run compile && cp -r ../framework/src/source ./dist/lib/framework",
|
|
58
|
-
"test": "
|
|
59
|
-
"
|
|
55
|
+
"test": "nyc mocha",
|
|
56
|
+
"test:nocover": "mocha",
|
|
57
|
+
"publish-coverage": "nyc report --reporter=text-lcov | coveralls",
|
|
60
58
|
"publish-npm": "npm run test && npm publish",
|
|
61
59
|
"publish-npm:beta": "npm run test && npm publish --tag=beta",
|
|
62
60
|
"local": "ts-node scripts/install-local.js",
|
|
@@ -82,7 +80,8 @@
|
|
|
82
80
|
},
|
|
83
81
|
"nyc": {
|
|
84
82
|
"include": [
|
|
85
|
-
"src
|
|
83
|
+
"src/**/*.ts",
|
|
84
|
+
"!src/**/*.spec.ts"
|
|
86
85
|
],
|
|
87
86
|
"extension": [
|
|
88
87
|
".ts"
|
|
@@ -109,6 +108,9 @@
|
|
|
109
108
|
"require": [
|
|
110
109
|
"source-map-support/register",
|
|
111
110
|
"ts-node/register"
|
|
111
|
+
],
|
|
112
|
+
"watchExtensions": [
|
|
113
|
+
"ts"
|
|
112
114
|
]
|
|
113
115
|
}
|
|
114
116
|
}
|