pumuki 6.3.159 → 6.3.160

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.
@@ -684,26 +684,45 @@ await fulfillment(of: [expectation], timeout: 1)
684
684
  assert.equal(hasSwiftWaitForExpectationsUsage(modernWait), false);
685
685
  });
686
686
 
687
- test('hasSwiftLegacyExpectationDescriptionUsage detecta expectation(description:) sin flujo moderno', () => {
688
- const legacyExpectation = `
687
+ test('hasSwiftLegacyExpectationDescriptionUsage detecta expectation(description:) en tests async sin flujo moderno', () => {
688
+ const legacyAsyncExpectation = `
689
+ func testLegacyAsync() async {
689
690
  let expectation = expectation(description: "Done")
690
691
  doWork { expectation.fulfill() }
691
- waitForExpectations(timeout: 1)
692
+ }
693
+ `;
694
+ const legacySyncExpectation = `
695
+ func testLegacySync() {
696
+ let expectation = expectation(description: "Done")
697
+ doWork { expectation.fulfill() }
698
+ }
692
699
  `;
693
- const modernExpectation = `
700
+ const modernAsyncExpectation = `
701
+ func testModernAsync() async {
694
702
  let expectation = expectation(description: "Done")
695
703
  doWork { expectation.fulfill() }
696
704
  await fulfillment(of: [expectation], timeout: 1)
705
+ }
697
706
  `;
698
- const confirmationOnly = `
707
+ const confirmationFlow = `
708
+ func testConfirmation() async {
699
709
  await confirmation("Done") { confirm in
700
710
  await doWork { confirm() }
701
711
  }
712
+ }
713
+ `;
714
+ const commentedExpectation = `
715
+ func testModernAsync() async {
716
+ // let expectation = expectation(description: "Done")
717
+ await confirmation("Done") { confirm in confirm() }
718
+ }
702
719
  `;
703
720
 
704
- assert.equal(hasSwiftLegacyExpectationDescriptionUsage(legacyExpectation), true);
705
- assert.equal(hasSwiftLegacyExpectationDescriptionUsage(modernExpectation), false);
706
- assert.equal(hasSwiftLegacyExpectationDescriptionUsage(confirmationOnly), false);
721
+ assert.equal(hasSwiftLegacyExpectationDescriptionUsage(legacyAsyncExpectation), true);
722
+ assert.equal(hasSwiftLegacyExpectationDescriptionUsage(legacySyncExpectation), false);
723
+ assert.equal(hasSwiftLegacyExpectationDescriptionUsage(modernAsyncExpectation), false);
724
+ assert.equal(hasSwiftLegacyExpectationDescriptionUsage(confirmationFlow), false);
725
+ assert.equal(hasSwiftLegacyExpectationDescriptionUsage(commentedExpectation), false);
707
726
  });
708
727
 
709
728
  test('hasSwiftNSManagedObjectBoundaryUsage detecta boundaries con NSManagedObject y excluye IDs o subclases', () => {
@@ -923,20 +923,15 @@ export const hasSwiftWaitForExpectationsUsage = (source: string): boolean => {
923
923
  };
924
924
 
925
925
  export const hasSwiftLegacyExpectationDescriptionUsage = (source: string): boolean => {
926
- const hasLegacyExpectation = collectSwiftRegexLines(
927
- source,
928
- /\bexpectation\s*\(\s*description\s*:/
929
- ).length > 0;
930
-
931
- if (!hasLegacyExpectation) {
932
- return false;
933
- }
934
-
935
- if (hasSwiftAwaitFulfillmentUsage(source) || hasSwiftConfirmationUsage(source)) {
936
- return false;
937
- }
938
-
939
- return true;
926
+ return collectSwiftFunctionDeclarations(source).some((declaration) => {
927
+ if (!/\basync\b/.test(declaration.signature)) {
928
+ return false;
929
+ }
930
+ if (!hasSwiftSanitizedRegexMatch(declaration.body, /\bexpectation\s*\(\s*description\s*:/)) {
931
+ return false;
932
+ }
933
+ return !hasSwiftAwaitFulfillmentUsage(declaration.body) && !hasSwiftConfirmationUsage(declaration.body);
934
+ });
940
935
  };
941
936
 
942
937
  export const hasSwiftNSManagedObjectBoundaryUsage = (source: string): boolean => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pumuki",
3
- "version": "6.3.159",
3
+ "version": "6.3.160",
4
4
  "description": "Enterprise-grade AST Intelligence System with multi-platform support (iOS, Android, Backend, Frontend) and Feature-First + DDD + Clean Architecture enforcement. Includes dynamic violations API for intelligent querying.",
5
5
  "main": "index.js",
6
6
  "bin": {