@lvce-editor/test-worker 16.2.0 → 16.3.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/dist/api.d.ts CHANGED
@@ -268,6 +268,7 @@ export type SelectItemWaitUntil = "done" | "quickPick" | "none";
268
268
  export type SearchInputType = "SearchValue" | "ReplaceValue" | "IncludeValue" | "ExcludeValue";
269
269
 
270
270
  interface Workspace {
271
+ readonly close: () => Promise<void>;
271
272
  readonly openTmpDir: () => Promise<string>;
272
273
  readonly setPath: (path: string) => Promise<void>;
273
274
  }
@@ -505,9 +506,13 @@ interface Editor {
505
506
  readonly goToDefinition: () => Promise<void>;
506
507
  readonly goToTypeDefinition: () => Promise<void>;
507
508
  readonly growSelection: () => Promise<void>;
509
+ readonly handleTab: () => Promise<void>;
510
+ readonly indentLess: () => Promise<void>;
511
+ readonly indentMore: () => Promise<void>;
508
512
  readonly insertLineBreak: () => Promise<void>;
509
513
  readonly invokeBraceCompletion: (text: string) => Promise<void>;
510
514
  readonly invokeTabCompletion: () => Promise<void>;
515
+ readonly moveLineDown: () => Promise<void>;
511
516
  readonly openColorPicker: () => Promise<void>;
512
517
  readonly openCompletion: () => Promise<void>;
513
518
  readonly openCompletionDetails: () => Promise<void>;
@@ -519,6 +524,7 @@ interface Editor {
519
524
  readonly openRename: () => Promise<void>;
520
525
  readonly openSourceActions: () => Promise<void>;
521
526
  readonly organizeImports: () => Promise<void>;
527
+ readonly pasteText: (text: string) => Promise<void>;
522
528
  readonly redo: () => Promise<void>;
523
529
  readonly rename: () => Promise<void>;
524
530
  readonly rename2: (newName: string) => Promise<void>;
@@ -533,6 +539,8 @@ interface Editor {
533
539
  readonly selectNextOccurrence: () => Promise<void>;
534
540
  readonly selectPreviousOccurrence: () => Promise<void>;
535
541
  readonly selectUp: () => Promise<void>;
542
+ readonly selectWordLeft: () => Promise<void>;
543
+ readonly selectWordRight: () => Promise<void>;
536
544
  readonly selectionGrow: () => Promise<void>;
537
545
  readonly setCursor: (rowIndex: number, columnIndex: number) => Promise<void>;
538
546
  readonly setDeltaY: (deltaY: number) => Promise<void>;
@@ -545,11 +553,13 @@ interface Editor {
545
553
  readonly shouldHaveTokens: (expectedTokens: readonly TokenRow[]) => Promise<void>;
546
554
  readonly showHover: () => Promise<void>;
547
555
  readonly sortImports: () => Promise<void>;
556
+ readonly sortLinesAscending: () => Promise<void>;
548
557
  readonly sourceActionsSelectCurrent: () => Promise<void>;
549
558
  readonly toggleBlockComment: () => Promise<void>;
550
559
  readonly toggleCompletionDetails: () => Promise<void>;
551
560
  readonly toggleLineComment: () => Promise<void>;
552
561
  readonly type: (text: string) => Promise<void>;
562
+ readonly typeWithAutoClosing: (text: string) => Promise<void>;
553
563
  readonly unIndent: () => Promise<void>;
554
564
  readonly undo: () => Promise<void>;
555
565
  }
@@ -1265,15 +1265,17 @@ const initializeOpenerWorker = async () => {
1265
1265
  set$3(rpc);
1266
1266
  };
1267
1267
 
1268
- let autoFixError;
1268
+ const state$3 = {
1269
+ autoFixError: undefined
1270
+ };
1269
1271
  const get$1 = () => {
1270
- return autoFixError;
1272
+ return state$3.autoFixError;
1271
1273
  };
1272
1274
  const set$1 = value => {
1273
- autoFixError = value;
1275
+ state$3.autoFixError = value;
1274
1276
  };
1275
1277
  const clear$3 = () => {
1276
- autoFixError = undefined;
1278
+ state$3.autoFixError = undefined;
1277
1279
  };
1278
1280
 
1279
1281
  class AssertionError extends Error {
@@ -1316,7 +1318,7 @@ const printLocator = locator => {
1316
1318
  result = part.selector;
1317
1319
  continue;
1318
1320
  }
1319
- result = `${result} >> ${part.selector}`;
1321
+ result += ` >> ${part.selector}`;
1320
1322
  continue;
1321
1323
  }
1322
1324
  if (part.type === 'text') {
@@ -1324,14 +1326,14 @@ const printLocator = locator => {
1324
1326
  result = `text=${part.text}`;
1325
1327
  continue;
1326
1328
  }
1327
- result = `${result} text=${part.text}`;
1329
+ result += ` text=${part.text}`;
1328
1330
  continue;
1329
1331
  }
1330
1332
  if (part.type === 'has-text') {
1331
- result = `${result} "${part.text}"`;
1333
+ result += ` "${part.text}"`;
1332
1334
  continue;
1333
1335
  }
1334
- result = `${result}:nth(${part.index})`;
1336
+ result += `:nth(${part.index})`;
1335
1337
  }
1336
1338
  return result;
1337
1339
  };
@@ -1618,7 +1620,7 @@ const nameAnonymousFunction = (fn, name) => {
1618
1620
 
1619
1621
  // @ts-nocheck
1620
1622
 
1621
- const state = {
1623
+ const state$2 = {
1622
1624
  mockRpcs: Object.create(null),
1623
1625
  /**
1624
1626
  * @type {any[]}
@@ -1626,7 +1628,7 @@ const state = {
1626
1628
  pendingTests: []
1627
1629
  };
1628
1630
  const addTest = (name, fn) => {
1629
- state.pendingTests.push({
1631
+ state$2.pendingTests.push({
1630
1632
  fn,
1631
1633
  name
1632
1634
  });
@@ -1634,7 +1636,7 @@ const addTest = (name, fn) => {
1634
1636
  const setMockRpc = mockRpc => {
1635
1637
  object(mockRpc);
1636
1638
  string$1(mockRpc.name);
1637
- state.mockRpcs[mockRpc.name] = mockRpc;
1639
+ state$2.mockRpcs[mockRpc.name] = mockRpc;
1638
1640
  };
1639
1641
 
1640
1642
  class CssParsingError extends Error {
@@ -1922,6 +1924,7 @@ const execute$1 = async (id, ...args) => {
1922
1924
  return invoke(id, ...args);
1923
1925
  };
1924
1926
  const executeExtensionCommand = async (commandId, ...args) => {
1927
+ // TODO maybe ask extension-management-worker instead
1925
1928
  return invoke('ExtensionHost.executeCommand', commandId, ...args);
1926
1929
  };
1927
1930
 
@@ -2235,11 +2238,11 @@ const assertObjectMatches = (actual, expected, path) => {
2235
2238
  if (!isObject$3(actual)) {
2236
2239
  throw new TypeError(`Expected ${path} to be an object but got ${formatValue(actual)}`);
2237
2240
  }
2238
- for (const key of Object.keys(expected)) {
2241
+ for (const [key, expectedValue] of Object.entries(expected)) {
2239
2242
  if (!Object.hasOwn(actual, key)) {
2240
2243
  throw new Error(`Expected ${path}.${key} to exist`);
2241
2244
  }
2242
- assertPayloadMatches(actual[key], expected[key], `${path}.${key}`);
2245
+ assertPayloadMatches(actual[key], expectedValue, `${path}.${key}`);
2243
2246
  }
2244
2247
  };
2245
2248
  const assertPrimitiveMatches = (actual, expected, path) => {
@@ -2608,6 +2611,9 @@ const directionMap = {
2608
2611
  horizontal: 1,
2609
2612
  vertical: 2
2610
2613
  };
2614
+ const isLayoutDirectionName = value => {
2615
+ return value === 'horizontal' || value === 'vertical';
2616
+ };
2611
2617
  const isObject$2 = value => {
2612
2618
  return typeof value === 'object' && value !== null && !Array.isArray(value) && !(value instanceof RegExp);
2613
2619
  };
@@ -2637,8 +2643,11 @@ const matchesExpectedObject = (actual, expected) => {
2637
2643
  return true;
2638
2644
  };
2639
2645
  const matchesExpected = (actual, expected, key = '') => {
2640
- if (key === 'direction' && typeof expected === 'string' && expected in directionMap) {
2641
- return Object.is(actual, directionMap[expected]);
2646
+ if (key === 'direction' && typeof expected === 'string' && isLayoutDirectionName(expected)) {
2647
+ if (expected === 'horizontal') {
2648
+ return Object.is(actual, directionMap.horizontal);
2649
+ }
2650
+ return Object.is(actual, directionMap.vertical);
2642
2651
  }
2643
2652
  if (expected instanceof RegExp) {
2644
2653
  return typeof actual === 'string' && expected.test(actual);
@@ -2830,13 +2839,32 @@ const areSelectionsEqual = (a, b) => {
2830
2839
  return true;
2831
2840
  };
2832
2841
 
2842
+ const areTokensEqual = (actual, expected) => {
2843
+ if (actual.length !== expected.length) {
2844
+ return false;
2845
+ }
2846
+ for (let i = 0; i < actual.length; i++) {
2847
+ const actualRow = actual[i];
2848
+ const expectedRow = expected[i];
2849
+ if (actualRow.length !== expectedRow.length) {
2850
+ return false;
2851
+ }
2852
+ for (let j = 0; j < actualRow.length; j++) {
2853
+ if (actualRow[j] !== expectedRow[j]) {
2854
+ return false;
2855
+ }
2856
+ }
2857
+ }
2858
+ return true;
2859
+ };
2860
+
2833
2861
  const getEditorKey = async () => {
2834
2862
  const keys = await invoke$4('Editor.getKeys');
2835
2863
  if (keys.length === 0) {
2836
2864
  throw new Error(`no editor found`);
2837
2865
  }
2838
2866
  const key = keys.at(-1);
2839
- const numeric = Number.parseFloat(key);
2867
+ const numeric = Number(key);
2840
2868
  return numeric;
2841
2869
  };
2842
2870
 
@@ -2925,6 +2953,12 @@ const cursorUp = async () => {
2925
2953
  const cursorWordLeft = async () => {
2926
2954
  await invoke('Editor.cursorWordLeft');
2927
2955
  };
2956
+ const selectWordLeft = async () => {
2957
+ await invoke('Editor.selectWordLeft');
2958
+ };
2959
+ const selectWordRight = async () => {
2960
+ await invoke('Editor.selectWordRight');
2961
+ };
2928
2962
  const setText = async text => {
2929
2963
  await invoke('Editor.setText', text);
2930
2964
  };
@@ -2997,6 +3031,27 @@ const setDeltaY$1 = async deltaY => {
2997
3031
  const format = async () => {
2998
3032
  await invoke('Editor.format');
2999
3033
  };
3034
+ const indentMore = async () => {
3035
+ await invoke('Editor.indentMore');
3036
+ };
3037
+ const indentLess = async () => {
3038
+ await invoke('Editor.indentLess');
3039
+ };
3040
+ const moveLineDown = async () => {
3041
+ await invoke('Editor.moveLineDown');
3042
+ };
3043
+ const pasteText = async text => {
3044
+ await invoke('Editor.pasteText', text);
3045
+ };
3046
+ const sortLinesAscending = async () => {
3047
+ await invoke('Editor.sortLinesAscending');
3048
+ };
3049
+ const typeWithAutoClosing = async text => {
3050
+ await invoke('Editor.typeWithAutoClosing', text);
3051
+ };
3052
+ const handleTab = async () => {
3053
+ await invoke('Editor.handleTab');
3054
+ };
3000
3055
  const unIndent = async () => {
3001
3056
  await invoke('Editor.unIndent');
3002
3057
  };
@@ -3106,24 +3161,6 @@ const shouldHaveText = async expectedText => {
3106
3161
  throw new Error(`Expected editor to have text ${expectedText} but was ${text}`);
3107
3162
  }
3108
3163
  };
3109
- const areTokensEqual = (actual, expected) => {
3110
- if (actual.length !== expected.length) {
3111
- return false;
3112
- }
3113
- for (let i = 0; i < actual.length; i++) {
3114
- const actualRow = actual[i];
3115
- const expectedRow = expected[i];
3116
- if (actualRow.length !== expectedRow.length) {
3117
- return false;
3118
- }
3119
- for (let j = 0; j < actualRow.length; j++) {
3120
- if (actualRow[j] !== expectedRow[j]) {
3121
- return false;
3122
- }
3123
- }
3124
- }
3125
- return true;
3126
- };
3127
3164
  const shouldHaveTokens = async expectedTokens => {
3128
3165
  const key = await getEditorKey();
3129
3166
  const text = await invoke$4('Editor.getTokens', key);
@@ -3226,9 +3263,13 @@ const Editor = {
3226
3263
  goToDefinition,
3227
3264
  goToTypeDefinition,
3228
3265
  growSelection,
3266
+ handleTab,
3267
+ indentLess,
3268
+ indentMore,
3229
3269
  insertLineBreak,
3230
3270
  invokeBraceCompletion,
3231
3271
  invokeTabCompletion,
3272
+ moveLineDown,
3232
3273
  openColorPicker,
3233
3274
  openCompletion,
3234
3275
  openCompletionDetails,
@@ -3240,6 +3281,7 @@ const Editor = {
3240
3281
  openRename,
3241
3282
  openSourceActions,
3242
3283
  organizeImports,
3284
+ pasteText,
3243
3285
  redo,
3244
3286
  rename: rename$1,
3245
3287
  rename2,
@@ -3254,6 +3296,8 @@ const Editor = {
3254
3296
  selectNextOccurrence,
3255
3297
  selectPreviousOccurrence,
3256
3298
  selectUp: selectUp$1,
3299
+ selectWordLeft,
3300
+ selectWordRight,
3257
3301
  selectionGrow,
3258
3302
  setCursor,
3259
3303
  setDeltaY: setDeltaY$1,
@@ -3266,11 +3310,13 @@ const Editor = {
3266
3310
  shouldHaveTokens,
3267
3311
  showHover,
3268
3312
  sortImports,
3313
+ sortLinesAscending,
3269
3314
  sourceActionsSelectCurrent,
3270
3315
  toggleBlockComment,
3271
3316
  toggleCompletionDetails,
3272
3317
  toggleLineComment,
3273
3318
  type,
3319
+ typeWithAutoClosing,
3274
3320
  unIndent,
3275
3321
  undo
3276
3322
  };
@@ -3281,7 +3327,7 @@ const selectIndex$6 = async index => {
3281
3327
  const selectCurrentIndex$2 = async () => {
3282
3328
  await invoke('EditorCompletion.selectCurrentIndex');
3283
3329
  };
3284
- const close$2 = async () => {
3330
+ const close$3 = async () => {
3285
3331
  await invoke('EditorCompletion.close');
3286
3332
  };
3287
3333
  const handleWheel$2 = async (deltaMode, deltaY) => {
@@ -3292,7 +3338,7 @@ const handlePointerdown = async (clientX, clientY) => {
3292
3338
  };
3293
3339
 
3294
3340
  const EditorCompletion = {
3295
- close: close$2,
3341
+ close: close$3,
3296
3342
  handlePointerdown,
3297
3343
  handleWheel: handleWheel$2,
3298
3344
  selectCurrentIndex: selectCurrentIndex$2,
@@ -3302,12 +3348,12 @@ const EditorCompletion = {
3302
3348
  const show$6 = async () => {
3303
3349
  await invoke('Editor.showHover2');
3304
3350
  };
3305
- const close$1 = async () => {
3351
+ const close$2 = async () => {
3306
3352
  await invoke('EditorHover.close');
3307
3353
  };
3308
3354
 
3309
3355
  const EditorHover = {
3310
- close: close$1,
3356
+ close: close$2,
3311
3357
  show: show$6
3312
3358
  };
3313
3359
 
@@ -3721,11 +3767,11 @@ const getFileMapNode = async url => {
3721
3767
  const contents = await Promise.all(allFiles.map(filePath => {
3722
3768
  return readFile$1(filePath);
3723
3769
  }));
3724
- allFiles.map((filePath, index) => {
3770
+ for (const [index, filePath] of allFiles.entries()) {
3725
3771
  const content = contents[index];
3726
3772
  const relativePaths = filePath.slice(fileUrl.length + 1);
3727
3773
  fileMap[relativePaths] = content;
3728
- });
3774
+ }
3729
3775
  return fileMap;
3730
3776
  };
3731
3777
 
@@ -3819,7 +3865,7 @@ const getParentUri = uri => {
3819
3865
  const pathSegments = url.pathname.split('/').filter(Boolean);
3820
3866
  pathSegments.pop();
3821
3867
  url.pathname = pathSegments.length === 0 ? '/' : `/${pathSegments.join('/')}`;
3822
- return url.toString();
3868
+ return url.href;
3823
3869
  };
3824
3870
  const getBaseName = uri => {
3825
3871
  const url = new URL(uri);
@@ -3947,7 +3993,7 @@ const focusNext$5 = async () => {
3947
3993
  const focusPrevious$5 = async () => {
3948
3994
  await invoke('FindWidget.focusPrevious');
3949
3995
  };
3950
- const close = async () => {
3996
+ const close$1 = async () => {
3951
3997
  await invoke('FindWidget.close');
3952
3998
  };
3953
3999
  const setReplaceValue$1 = async value => {
@@ -3988,7 +4034,7 @@ const focusPreviousElement = async () => {
3988
4034
  };
3989
4035
 
3990
4036
  const FindWidget = {
3991
- close,
4037
+ close: close$1,
3992
4038
  focusElement,
3993
4039
  focusNext: focusNext$5,
3994
4040
  focusNextElement,
@@ -4323,33 +4369,41 @@ const Control = 'Control';
4323
4369
  const Space = 'Space';
4324
4370
  const Alt = 'Alt';
4325
4371
 
4372
+ const applyKeyPart = (part, options) => {
4373
+ switch (part) {
4374
+ case Alt:
4375
+ {
4376
+ options.altKey = true;
4377
+ return;
4378
+ }
4379
+ case Control:
4380
+ {
4381
+ options.ctrlKey = true;
4382
+ return;
4383
+ }
4384
+ case Space:
4385
+ {
4386
+ options.key = ' ';
4387
+ return;
4388
+ }
4389
+ default:
4390
+ {
4391
+ options.key = part;
4392
+ }
4393
+ }
4394
+ };
4326
4395
  const getKeyOptions = rawKey => {
4327
4396
  if (rawKey.includes('+')) {
4328
4397
  const parts = rawKey.split('+');
4329
- let ctrlKey = false;
4330
- let altKey = false;
4331
- let key = '';
4398
+ const options = {
4399
+ altKey: false,
4400
+ ctrlKey: false,
4401
+ key: ''
4402
+ };
4332
4403
  for (const part of parts) {
4333
- switch (part) {
4334
- case Alt:
4335
- altKey = true;
4336
- break;
4337
- case Control:
4338
- ctrlKey = true;
4339
- break;
4340
- case Space:
4341
- key = ' ';
4342
- break;
4343
- default:
4344
- key = part;
4345
- break;
4346
- }
4404
+ applyKeyPart(part, options);
4347
4405
  }
4348
- return {
4349
- altKey,
4350
- ctrlKey,
4351
- key
4352
- };
4406
+ return options;
4353
4407
  }
4354
4408
  return {
4355
4409
  altKey: false,
@@ -4487,11 +4541,12 @@ const getIsFirefox = () => {
4487
4541
  if (typeof navigator === 'undefined') {
4488
4542
  return false;
4489
4543
  }
4490
- if (
4491
4544
  // @ts-expect-error
4492
- navigator.userAgentData?.brands) {
4493
- // @ts-expect-error
4494
- return navigator.userAgentData.brands.includes('Firefox');
4545
+ const {
4546
+ userAgentData
4547
+ } = navigator;
4548
+ if (userAgentData?.brands) {
4549
+ return userAgentData.brands.includes('Firefox');
4495
4550
  }
4496
4551
  return navigator.userAgent.toLowerCase().includes('firefox');
4497
4552
  };
@@ -4647,6 +4702,13 @@ const focusIndex$2 = async index => {
4647
4702
  const focusPrevious$2 = async () => {
4648
4703
  await invoke('QuickPick.focusPrevious');
4649
4704
  };
4705
+ const ignoreSelectionFailure = async promise => {
4706
+ try {
4707
+ await promise;
4708
+ } catch {
4709
+ // ignore selection failures for fire-and-forget selection flows
4710
+ }
4711
+ };
4650
4712
  const selectItem = async (label, {
4651
4713
  waitUntil = 'done'
4652
4714
  } = {}) => {
@@ -4657,10 +4719,10 @@ const selectItem = async (label, {
4657
4719
  const visiblePromise = waitUntil === 'quickPick' ? invoke('QuickPick.waitUntilVisible') : undefined;
4658
4720
  const promise = Promise.resolve(invoke('QuickPick.selectItem', label));
4659
4721
  if (waitUntil === 'none') {
4660
- void promise.catch(() => undefined);
4722
+ void ignoreSelectionFailure(promise);
4661
4723
  return;
4662
4724
  }
4663
- void promise.catch(() => undefined);
4725
+ void ignoreSelectionFailure(promise);
4664
4726
  await visiblePromise;
4665
4727
  };
4666
4728
  const selectIndex$3 = async index => {
@@ -5089,12 +5151,15 @@ const TitleBarMenuBar = {
5089
5151
  toggleMenu
5090
5152
  };
5091
5153
 
5092
- let url = '';
5154
+ const state$1 = {
5155
+ url: ''
5156
+ };
5093
5157
  const setUrl = newUrl => {
5094
- url = newUrl;
5158
+ state$1.url = newUrl;
5095
5159
  };
5096
5160
  const resolve = relativePath => {
5097
- return new URL(relativePath, url).toString();
5161
+ const resolvedUrl = new URL(relativePath, state$1.url);
5162
+ return resolvedUrl.href;
5098
5163
  };
5099
5164
 
5100
5165
  const Url = {
@@ -5186,8 +5251,12 @@ const openTmpDir = async () => {
5186
5251
  await setPath(tmpDir);
5187
5252
  return tmpDir;
5188
5253
  };
5254
+ const close = async () => {
5255
+ await invoke('Workspace.close');
5256
+ };
5189
5257
 
5190
5258
  const Workspace = {
5259
+ close,
5191
5260
  openTmpDir,
5192
5261
  setPath
5193
5262
  };
@@ -5410,7 +5479,7 @@ const importScript = async url => {
5410
5479
  } catch (error) {
5411
5480
  throw error;
5412
5481
  // TODO
5413
- // const actualErrorMessage = await TryToGetactualImportErrorMessage.tryToGetActualImportErrorMessage(url, error)
5482
+ // const actualErrorMessage = await TryToGetactualImportErrorMessage.tryToGetActualImportErrorMessage(URL, error)
5414
5483
  // throw new Error(actualErrorMessage)
5415
5484
  }
5416
5485
  };
@@ -5423,12 +5492,14 @@ const importTest = async url => {
5423
5492
  }
5424
5493
  };
5425
5494
 
5426
- let items = [];
5495
+ const state = {
5496
+ items: []
5497
+ };
5427
5498
  const push = item => {
5428
- items = [...items, item];
5499
+ state.items = [...state.items, item];
5429
5500
  };
5430
5501
  const maybeLast = () => {
5431
- return items.at(-1);
5502
+ return state.items.at(-1);
5432
5503
  };
5433
5504
 
5434
5505
  const getFileUri = href => {
@@ -5463,7 +5534,7 @@ const execute = async (href, platform, assetDir) => {
5463
5534
  const globals = createApi(platform, assetDir);
5464
5535
  // TODO
5465
5536
  // 0. wait for page to be ready
5466
- // 1. get script to import from renderer process (url or from html)
5537
+ // 1. get script to import from renderer process (URL or from HTML)
5467
5538
  const scriptUrl = href;
5468
5539
  setUrl(scriptUrl); // TODO avoid side effect
5469
5540
  try {
@@ -5518,8 +5589,8 @@ const doHotReload = async (url, platform, assetDir) => {
5518
5589
 
5519
5590
  const createUrlWithQueryParameter = (url, locationHref, time) => {
5520
5591
  const parsedUrl = new URL(url, locationHref);
5521
- parsedUrl.searchParams.set('time', `${time}`);
5522
- const string = parsedUrl.toString();
5592
+ parsedUrl.searchParams.set('time', String(time));
5593
+ const string = parsedUrl.href;
5523
5594
  return string;
5524
5595
  };
5525
5596
 
@@ -5630,7 +5701,7 @@ const consumeComment = (inBlockComment, inLineComment, character, nextCharacter)
5630
5701
  };
5631
5702
 
5632
5703
  const isStringDelimiter = character => {
5633
- return character === "'" || character === '"' || character === '`';
5704
+ return [`'`, '"', '`'].includes(character);
5634
5705
  };
5635
5706
 
5636
5707
  const consumeString = (stringDelimiter, character) => {
@@ -5757,11 +5828,11 @@ const projectActualOntoExpected = (actualValue, expectedValue) => {
5757
5828
  return actualValue;
5758
5829
  }
5759
5830
  const result = {};
5760
- for (const key of Object.keys(expectedValue)) {
5831
+ for (const [key, nestedExpectedValue] of Object.entries(expectedValue)) {
5761
5832
  if (!Object.hasOwn(actualValue, key)) {
5762
5833
  continue;
5763
5834
  }
5764
- result[key] = projectActualOntoExpected(actualValue[key], expectedValue[key]);
5835
+ result[key] = projectActualOntoExpected(actualValue[key], nestedExpectedValue);
5765
5836
  }
5766
5837
  return result;
5767
5838
  }
@@ -5873,7 +5944,7 @@ const toFileUrl = (url, locationHref) => {
5873
5944
  if (parsedUrl.protocol === 'file:') {
5874
5945
  parsedUrl.hash = '';
5875
5946
  parsedUrl.search = '';
5876
- return parsedUrl.toString();
5947
+ return parsedUrl.href;
5877
5948
  }
5878
5949
  return getFileUrlFromRemotePath(parsedUrl.pathname);
5879
5950
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/test-worker",
3
- "version": "16.2.0",
3
+ "version": "16.3.0",
4
4
  "description": "Test Worker",
5
5
  "repository": {
6
6
  "type": "git",