@usebruno/js 0.38.0 → 0.40.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.
- package/package.json +3 -4
- package/src/bruno-request.js +9 -0
- package/src/runtime/test-runtime.js +3 -1
- package/src/sandbox/bundle-browser-rollup.js +11 -11
- package/src/sandbox/bundle-libraries.js +2 -3
- package/src/sandbox/quickjs/index.js +4 -0
- package/src/sandbox/quickjs/shims/bruno-request.js +9 -0
- package/src/sandbox/quickjs/shims/lib/crypto-utils.js +104 -0
- package/src/sandbox/quickjs/shims/lib/crypto-utils.spec.js +73 -0
- package/src/sandbox/quickjs/shims/lib/utils.js +48 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usebruno/js",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.40.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"files": [
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@usebruno/common": "0.12.1",
|
|
20
|
-
"@usebruno/crypto-js": "^3.1.9",
|
|
21
20
|
"@usebruno/query": "0.1.0",
|
|
22
21
|
"ajv": "^8.12.0",
|
|
23
22
|
"ajv-formats": "^2.1.1",
|
|
@@ -27,7 +26,7 @@
|
|
|
27
26
|
"chai": "^4.3.7",
|
|
28
27
|
"chai-string": "^1.5.0",
|
|
29
28
|
"cheerio": "^1.0.0",
|
|
30
|
-
"crypto-js": "^4.
|
|
29
|
+
"crypto-js": "^4.2.0",
|
|
31
30
|
"json-query": "^2.2.2",
|
|
32
31
|
"lodash": "^4.17.21",
|
|
33
32
|
"moment": "^2.29.4",
|
|
@@ -46,4 +45,4 @@
|
|
|
46
45
|
"rollup": "3.29.5",
|
|
47
46
|
"rollup-plugin-terser": "^7.0.2"
|
|
48
47
|
}
|
|
49
|
-
}
|
|
48
|
+
}
|
package/src/bruno-request.js
CHANGED
|
@@ -22,6 +22,7 @@ class BrunoRequest {
|
|
|
22
22
|
this.timeout = req.timeout;
|
|
23
23
|
this.historyLogger = historyLogger;
|
|
24
24
|
this.name = req.name;
|
|
25
|
+
this.tags = req.tags || [];
|
|
25
26
|
/**
|
|
26
27
|
* We automatically parse the JSON body if the content type is JSON
|
|
27
28
|
* This is to make it easier for the user to access the body directly
|
|
@@ -210,6 +211,14 @@ class BrunoRequest {
|
|
|
210
211
|
getName() {
|
|
211
212
|
return this.req.name;
|
|
212
213
|
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Get the tags associated with this request
|
|
217
|
+
* @returns {Array<string>} Array of tag strings
|
|
218
|
+
*/
|
|
219
|
+
getTags() {
|
|
220
|
+
return this.req.tags || [];
|
|
221
|
+
}
|
|
213
222
|
}
|
|
214
223
|
|
|
215
224
|
module.exports = BrunoRequest;
|
|
@@ -135,7 +135,8 @@ class TestRuntime {
|
|
|
135
135
|
if (this.runtime === 'quickjs') {
|
|
136
136
|
await executeQuickJsVmAsync({
|
|
137
137
|
script: testsFile,
|
|
138
|
-
context: context
|
|
138
|
+
context: context,
|
|
139
|
+
collectionPath
|
|
139
140
|
});
|
|
140
141
|
} else if (this.runtime === 'nodevm') {
|
|
141
142
|
await runScriptInNodeVm({
|
|
@@ -151,6 +152,7 @@ class TestRuntime {
|
|
|
151
152
|
require: {
|
|
152
153
|
context: 'sandbox',
|
|
153
154
|
external: true,
|
|
155
|
+
builtin: ['*'],
|
|
154
156
|
root: [collectionPath, ...additionalContextRootsAbsolute],
|
|
155
157
|
mock: {
|
|
156
158
|
// node libs
|