Skip to content

test: plugin function with empty object return #15

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

Merged
merged 4 commits into from
Jan 11, 2021
Merged

Conversation

gr2m
Copy link
Owner

@gr2m gr2m commented Mar 2, 2020

Follow up for https://github.com/octokit/rest.js/pull/1625

The test passes, but the TypeScript typeahead is not workin in VS Code for me

Kapture 2020-03-02 at 11 15 11

Here is the code from the gif

import { Base } from "./src"

function plugin1 (base: Base) {
  return {
    plugin1 () {}
  }
}

function plugin2 (base: Base) {
  return {
    plugin2 () {}
  }
}

function plugin3 (base: Base) {
  return {
    // plugin3 () {}
  }
}

const Test = Base.plugin([plugin1, plugin2, plugin3])
const test = new Test()

test.p

I hope it will be easier to get to the bottom of this with this reduced test case, compared to all the baggage that Octokit brings.

Besides fixing the problem, I wonder if anyone has an idea how to add a breaking test for this case?

ping @wolfy1339

@gr2m
Copy link
Owner Author

gr2m commented Mar 2, 2020

Here is a TypeScript playground link with the most minimal test case I could come up with: playground link

Toggle line 63 and check the typeahead for test.pl in the last line

@gr2m
Copy link
Owner Author

gr2m commented Mar 24, 2020

See the workaround at octokit/core.js#53

@gr2m gr2m force-pushed the octokit/rest.js#1625 branch from 19aefc0 to 59da772 Compare January 11, 2021 17:15
@gr2m gr2m force-pushed the octokit/rest.js#1625 branch from 59da772 to 9eef5a0 Compare January 11, 2021 17:27
@gr2m gr2m merged commit aa6c39d into master Jan 11, 2021
@gr2m gr2m deleted the octokit/rest.js#1625 branch January 11, 2021 17:34
@github-actions
Copy link

🎉 This PR is included in version 2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

1 participant