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

[@testing-library/vue] New type definition #37655

Merged
merged 1 commit into from
Aug 16, 2019
Merged

[@testing-library/vue] New type definition #37655

merged 1 commit into from
Aug 16, 2019

Conversation

cimbul
Copy link
Contributor

@cimbul cimbul commented Aug 15, 2019

This is for version 1.2. Version 2.0 was recently released two days ago, but the types will require minimal changes. I think it makes sense to get the types for this version published before making the update.


  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Test the change in your own code. (Compile and run.)
  • Add or edit tests to reflect the change. (Run with npm test.)
  • Follow the advice from the readme.
  • Avoid common mistakes.
  • Run npm run lint package-name (or tsc if no tslint.json is present).

If adding a new definition:

@cimbul
Copy link
Contributor Author

cimbul commented Aug 15, 2019

Travis build failed with an error about the dependency whitelist, but I already have a PR merged in types-publisher for that: microsoft/types-publisher#643. Is there something else that needs to happen on the DefinitelyTyped side to get that change?

Error: In package.json: Dependency @vue/test-utils not in whitelist.
If you are depending on another @types package, do not add it to a package.json. Path mapping should make the import work.
If this is an external library that provides typings, please make a pull request to types-publisher adding it to dependenciesWhitelist.txt.

@typescript-bot
Copy link
Contributor

👋 Hi there! I’ve run some quick performance metrics against master and your PR. This is still an experiment, so don’t panic if I say something crazy! I’m still learning how to interpret these metrics.

Let’s review the numbers, shall we?

These typings are for a package that doesn’t yet exist on master, so I don’t have anything to compare against yet! In the future, I’ll be able to compare PRs to testing-library__vue with its source on master.

Comparison details 📊
Batch compilation
Type count 13185
Assignability cache size 34613
Subtype cache size 23
Identity cache size 3
Language service measurements
Samples taken 462
Identifiers in tests 462
getCompletionsAtPosition
    Mean duration (ms) 423.0
    Median duration (ms) 420.8
    Mean CV 13.2%
    Worst duration (ms) 569.3
    Worst identifier normalizer
getQuickInfoAtPosition
    Mean duration (ms) 418.9
    Median duration (ms) 416.1
    Mean CV 13.7%
    Worst duration (ms) 565.3
    Worst identifier x
System information
Node version v10.16.1
CPU count 2
CPU speed 2.397 GHz
CPU model Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz
CPU Architecture x64
Memory 6.8 GiB
Platform linux
Release 4.15.0-1052-azure

If you have any questions or comments about me, you can ping @andrewbranch. Have a nice day!

@johnnyreilly
Copy link
Member

@sandersn would you be able to advise on the types publisher issue please?

@typescript-bot typescript-bot added New Definition This PR creates a new definition package. The Travis CI build failed labels Aug 15, 2019
@typescript-bot
Copy link
Contributor

typescript-bot commented Aug 15, 2019

@cimbul Thank you for submitting this PR!

Because this is a new definition, a DefinitelyTyped maintainer will be reviewing this PR in the next few days once the Travis CI build passes.

In the meantime, if the build fails or a merge conflict occurs, I'll let you know. Have a nice day!

@typescript-bot
Copy link
Contributor

typescript-bot commented Aug 15, 2019

@cimbul The Travis CI build failed! Please review the logs for more information.

Once you've pushed the fixes, the build will automatically re-run. Thanks!


// Reexports event functions from dom-testing-library
// Note that it does NOT make the core fireEvent() function asynchronous
lib.fireEvent(elem, new Event('change')); // $ExpectType boolean
Copy link
Contributor

@afontcu afontcu Aug 15, 2019

Choose a reason for hiding this comment

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

edit: okay, just read your sentence of the PR. My bad!


AFAIK, fireEvent() is returning a Promise (source), and here it appears to be returning a boolean

disclaimer: I might be missing something basic, as I have no experience with type definitions 😇

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I'll get this updated to 2.0 after we get 1.2 published. (Or I could just do that now if we want to avoid another PR—I don't feel that strongly about it.)

@sandersn
Copy link
Contributor

@johnnyreilly caching on Travis isn't aware of updates from github references in package.json. So I have to manually invalidate the cache until I figure out how to to fix that.

@johnnyreilly
Copy link
Member

So I have to manually invalidate the cache until I figure out how to to fix that.

Awesome; this just proves the truth of Phil Karlton's maxim 😁

There are only two hard things in Computer Science: cache invalidation and naming things.

@johnnyreilly johnnyreilly merged commit 4648d94 into DefinitelyTyped:master Aug 16, 2019
@cimbul
Copy link
Contributor Author

cimbul commented Aug 16, 2019

@sandersn @johnnyreilly It looks like basically everyone's PR builds are failing since this got merged in... 😬

@sandersn
Copy link
Contributor

@cimbul thanks for the warning. Turns out my cache invalidation yesterday didn't take?? Anyway, everything should be fine now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New Definition This PR creates a new definition package.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants