Skip to content
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

fix(get-function-name-with-kind): fix default exported function name #26

Merged
merged 1 commit into from
Nov 28, 2022

Conversation

fisker
Copy link

@fisker fisker commented Nov 28, 2022

@MichaelDeBoey MichaelDeBoey changed the title feat: Fix default exported function name feat(get-function-name-with-kind): fix default exported function name Nov 28, 2022
@MichaelDeBoey MichaelDeBoey changed the title feat(get-function-name-with-kind): fix default exported function name fix(get-function-name-with-kind): fix default exported function name Nov 28, 2022
@codecov-commenter
Copy link

codecov-commenter commented Nov 28, 2022

Codecov Report

Base: 96.01% // Head: 96.03% // Increases project coverage by +0.01% 🎉

Coverage data is based on head (1711ea9) compared to base (4e50299).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #26      +/-   ##
==========================================
+ Coverage   96.01%   96.03%   +0.01%     
==========================================
  Files          13       13              
  Lines         653      655       +2     
==========================================
+ Hits          627      629       +2     
  Misses         26       26              
Impacted Files Coverage Δ
src/get-function-name-with-kind.js 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@MichaelDeBoey
Copy link
Member

Without the fix, added tests were failing like:

  1) The 'getFunctionNameWithKind' function
       should return "async generator function 'default'" for "export default async function* () {}".:

      AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
+ actual - expected

+ 'async generator function'
- "async generator function 'default'"
      + expected - actual

      -async generator function
      +async generator function 'default'
      
      at Context.<anonymous> (test/get-function-name-with-kind.js:159:20)
      at processImmediate (node:internal/timers:464:21)

  2) The 'getFunctionNameWithKind' function
       should return "async generator function 'default'" for "export default async function* () {}" if sourceCode is present.:

      AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
+ actual - expected

+ 'async generator function'
- "async generator function 'default'"
      + expected - actual

      -async generator function
      +async generator function 'default'
      
      at Context.<anonymous> (test/get-function-name-with-kind.js:189:20)
      at processImmediate (node:internal/timers:464:21)

  3) The 'getFunctionNameWithKind' function
       should return "async arrow function 'default'" for "export default async () => {}".:

      AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
+ actual - expected

+ 'async arrow function'
- "async arrow function 'default'"
      + expected - actual

      -async arrow function
      +async arrow function 'default'
      
      at Context.<anonymous> (test/get-function-name-with-kind.js:159:20)
      at processImmediate (node:internal/timers:464:21)

  4) The 'getFunctionNameWithKind' function
       should return "async arrow function 'default'" for "export default async () => {}" if sourceCode is present.:

      AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
+ actual - expected

+ 'async arrow function'
- "async arrow function 'default'"
      + expected - actual

      -async arrow function
      +async arrow function 'default'

@MichaelDeBoey MichaelDeBoey requested a review from a team November 28, 2022 02:53
Copy link
Member

@ota-meshi ota-meshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@MichaelDeBoey MichaelDeBoey merged commit 9be40ab into eslint-community:main Nov 28, 2022
@github-actions
Copy link

🎉 This PR is included in version 4.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@fisker fisker deleted the export-default-function branch November 28, 2022 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Function name for export default function() {}
4 participants