@lvce-editor/test-worker 14.16.0 → 14.17.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.
@@ -4890,6 +4890,22 @@ const formatDuration = duration => {
4890
4890
  const Fail = 'fail';
4891
4891
  const Pass = 'pass';
4892
4892
 
4893
+ const getAutoFixProperties = error => {
4894
+ const isChatDebugPayloadError = error instanceof ChatDebugShouldHavePayloadError && error.actualPayload !== undefined;
4895
+ const autoFixProperties = isChatDebugPayloadError ? {
4896
+ autoFixError: {
4897
+ actualPayload: error.actualPayload,
4898
+ code: error.code,
4899
+ expectedPayload: error.expectedPayload
4900
+ },
4901
+ overlayActions: [{
4902
+ command: 'Test.tryAutoFix',
4903
+ id: 'chat-debug-should-have-payload-autofix',
4904
+ label: 'Autofix'
4905
+ }]
4906
+ } : {};
4907
+ return autoFixProperties;
4908
+ };
4893
4909
  const executeTest2 = async (name, fn, globals, timestampGenerator) => {
4894
4910
  const getTimestamp = timestampGenerator;
4895
4911
  const start = getTimestamp();
@@ -4898,19 +4914,7 @@ const executeTest2 = async (name, fn, globals, timestampGenerator) => {
4898
4914
  const duration = end - start;
4899
4915
  const formattedDuration = formatDuration(duration);
4900
4916
  if (error) {
4901
- const isChatDebugPayloadError = error instanceof ChatDebugShouldHavePayloadError && error.actualPayload !== undefined;
4902
- const autoFixProperties = isChatDebugPayloadError ? {
4903
- autoFixError: {
4904
- actualPayload: error.actualPayload,
4905
- code: error.code,
4906
- expectedPayload: error.expectedPayload
4907
- },
4908
- overlayActions: [{
4909
- command: 'Test.tryAutoFix',
4910
- id: 'chat-debug-should-have-payload-autofix',
4911
- label: 'Autofix'
4912
- }]
4913
- } : {};
4917
+ const autoFixProperties = getAutoFixProperties(error);
4914
4918
  return {
4915
4919
  background: 'red',
4916
4920
  duration,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/test-worker",
3
- "version": "14.16.0",
3
+ "version": "14.17.0",
4
4
  "description": "Test Worker",
5
5
  "repository": {
6
6
  "type": "git",