Skip to content

Commit db6645a

Browse files
Kyle KeatingLMS007
authored andcommitted
Remove contextWrites from testResult
contextWrites is an internal array that should not propagate up to the reuslt.
1 parent 9f0fa88 commit db6645a

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

src/RapidTest.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,19 @@ async function executeTest(testExecution, locationDetails) {
3030
consola.error(e);
3131
error = e;
3232
} finally {
33-
testResult = testResult || {
34-
apiCalls: [],
35-
elapsedTime: 0,
36-
success: false,
37-
error: error?.message,
38-
actionReports: [],
39-
timedOut: false,
40-
};
33+
if (testResult) {
34+
// remove internal data not to be returned to the service
35+
delete testResult.contextWrites;
36+
} else {
37+
testResult = {
38+
apiCalls: [],
39+
elapsedTime: 0,
40+
success: false,
41+
error: error?.message,
42+
actionReports: [],
43+
timedOut: false,
44+
};
45+
}
4146
}
4247

4348
const headers = {

0 commit comments

Comments
 (0)