rooibos-roku 4.7.0 → 4.8.0
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.
|
@@ -1603,14 +1603,17 @@ namespace rooibos
|
|
|
1603
1603
|
return fake
|
|
1604
1604
|
end function
|
|
1605
1605
|
|
|
1606
|
-
function expectCalled(invocation as dynamic, returnValue = invalid as dynamic) as object
|
|
1606
|
+
function expectCalled(invocation as dynamic, returnValue = invalid as dynamic, thrownError = invalid as dynamic) as object
|
|
1607
1607
|
'mock function body - the plugin replaces this
|
|
1608
1608
|
return invalid
|
|
1609
1609
|
end function
|
|
1610
1610
|
|
|
1611
|
-
function _expectCalled(target, methodName, expectedArgs = invalid, returnValue = invalid as dynamic) as object
|
|
1611
|
+
function _expectCalled(target, methodName, expectedArgs = invalid, returnValue = invalid as dynamic, thrownError = invalid as dynamic) as object
|
|
1612
1612
|
try
|
|
1613
|
-
|
|
1613
|
+
mock = m.mock(target, methodName, 1, expectedArgs, returnValue, true)
|
|
1614
|
+
if thrownError <> invalid
|
|
1615
|
+
mock.toThrow(thrownError)
|
|
1616
|
+
end if
|
|
1614
1617
|
catch error
|
|
1615
1618
|
'bs:disable-next-line
|
|
1616
1619
|
m.currentResult.fail("Setting up mock failed: " + error.message, m.currentAssertLineNumber)
|
|
@@ -1884,9 +1887,11 @@ namespace rooibos
|
|
|
1884
1887
|
expectedArgsValues.push(defaultValue)
|
|
1885
1888
|
end if
|
|
1886
1889
|
end for
|
|
1890
|
+
'todo - make into a class
|
|
1887
1891
|
fake = {
|
|
1888
1892
|
id: id,
|
|
1889
1893
|
target: target,
|
|
1894
|
+
errorToThrow: invalid,
|
|
1890
1895
|
methodName: methodName,
|
|
1891
1896
|
returnValue: returnValue,
|
|
1892
1897
|
lineNumbers: lineNumbers,
|
|
@@ -1911,6 +1916,9 @@ namespace rooibos
|
|
|
1911
1916
|
'bs:disable-next-line
|
|
1912
1917
|
m.invocations++
|
|
1913
1918
|
|
|
1919
|
+
if m.errorToThrow <> invalid
|
|
1920
|
+
throw m.errorToThrow
|
|
1921
|
+
end if
|
|
1914
1922
|
'bs:disable-next-line
|
|
1915
1923
|
if type(m.returnValue) = "roAssociativeArray" and m.returnValue.doesExist("multiResult")
|
|
1916
1924
|
'bs:disable-next-line
|
|
@@ -1935,6 +1943,9 @@ namespace rooibos
|
|
|
1935
1943
|
return m.returnValue
|
|
1936
1944
|
end if
|
|
1937
1945
|
end function
|
|
1946
|
+
toThrow: function(error)
|
|
1947
|
+
m.errorToThrow = error
|
|
1948
|
+
end function
|
|
1938
1949
|
}
|
|
1939
1950
|
return fake
|
|
1940
1951
|
end function
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
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,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B;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.0",
|
|
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
29
|
"brighterscript": "0.45.3",
|
|
32
30
|
"chai": "^4.2.0",
|
|
33
|
-
"chai-files": "^1.4.0",
|
|
34
31
|
"chai-subset": "^1.6.0",
|
|
32
|
+
"coveralls": "^3.0.0",
|
|
35
33
|
"eslint": "^7.11.0",
|
|
36
|
-
"eslint-plugin-github": "^4.1.1",
|
|
37
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
|
}
|