strong-mock
ts-pattern
strong-mock | ts-pattern | |
---|---|---|
4 | 38 | |
92 | 10,907 | |
- | - | |
7.5 | 8.6 | |
13 days ago | 19 days ago | |
TypeScript | TypeScript | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
strong-mock
-
libraries you are happy that you discovered them
Shameless plug, but feel free to try https://github.com/NiGhTTraX/strong-mock as an alternative.
- strong-mock: Type safe mocking library for TypeScript
-
"as unknown as Promise<Response>" if you don't want to mock the whole Response object
If checking that getData is called using the correct input, consider using strong-mock.
-
How do you test an Axios call to a GraphQL API in React?
Depending on how you want to check the call, you might want to use a spying library (sinon, jest.fn etc). Check out strong-mock if you're using TypeScript.
ts-pattern
-
You Don't Need React
ts-pattern has been a decent band-aid for the lack of native pattern matching, but obviously has downsides that could be avoided if it was built into the language.
https://github.com/gvergnaud/ts-pattern
- Stop nesting ternaries
-
Building React Components Using Unions in TypeScript
ts-pattern
- Pattern Matching Library for TypeScript
-
TypeScript Is Surprisingly OK for Compilers
With how powerful the type system is you can implement pattern matching via a library pretty convincingly, https://github.com/gvergnaud/ts-pattern is definitely the go-to. That being said pattern matching is hardly a requirement for being ok for implementing compilers.
-
How to achieve type safety here possible without "type hacks"?
https://github.com/gvergnaud/ts-pattern might help
- ts-pattern v5
-
[AskJS] C# in every Node.js job posting?
There's a proposal to add something like that to JavaScript but it's been stuck in limbo since 2017 although there are libraries like ts-pattern which implement it already.
- Simplifying Dynamic Classes in Vue with the class-variance-authority library | cdruc.com
- Rust Appreciation Thread
What are some alternatives?
ts-mockito - Mocking library for TypeScript
pattern-grab - 🤛🏻 Regular Expression Data Grabber
mock-inspect - Mocks network requests and allows you to make assertions about how these requests happened. Supports auto-mocking of graphQL requests given a valid schema.
ts-adt - Generate Algebraic Data Types and pattern matchers
data - Data modeling and relation library for testing JavaScript applications.
await-to-js - Async await wrapper for easy error handling without try-catch
wonka - 🎩 A tiny but capable push & pull stream library for TypeScript and Flow
union-types - A Typescript library for creating discriminating union types.
ng-mocks - Angular testing library for mocking components, directives, pipes, services and facilitating TestBed setup
ts-option
shoehorn - Work seamlessly with partial mocks in TypeScript.
typescript-coverage-report - Node command tool to generate TypeScript coverage report