Skip to content

Feat: Add custom method name to enforce-close-testing-module #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
thiagomini opened this issue Dec 6, 2023 · 0 comments · Fixed by #11
Closed

Feat: Add custom method name to enforce-close-testing-module #10

thiagomini opened this issue Dec 6, 2023 · 0 comments · Fixed by #11
Assignees
Labels
enhancement New feature or request

Comments

@thiagomini
Copy link
Contributor

thiagomini commented Dec 6, 2023

Description

The enforce-close-testing-module rule doesn't support custom method names that could replace the testingModule.close() and Test.createTestingModule() calls. We need to add that option so users can create utility methods that are proxies for those calls.

Acceptance Criteria

The user can define an option with the enforce-close-testing-module rule so that ESLint recognizes custom functions:

// ...
rules: {
  '@trilon/enforce-close-testing-module': [ 
   'warn', {  
     closeAliases: [ 
       { kind: 'function', name: 'close' } 
     ],
     createAliases: [ 
       { kind: 'function', name: 'setupTest' } 
     ]  
   }
  ]
}

The configuration above defines:

  • close() as a custom function that should be interpreted the same as testingModule.close()
  • setupTest() as a custom function that should be interpreted the same as Test.createTestingModule()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant