10 Best Vanilla JavaScript Mocking Libraries

List hand-picked by Openbase Experts
Learn More

nm

ng-mocks

Angular testing library for mocking components, directives, pipes, services and facilitating TestBed setup

License Icon
License: MIT
TypeScript Icon
TypeScript Definitions: Built-In
User Rating
5.0/ 5
1
Top Feedback
1Great Documentation
1Easy to Use
1Highly Customizable
GitHub Stars
547
Weekly Downloads
166K
Last Commit
1mo ago
fak

faker

generate massive amounts of realistic fake data in Node.js and the browser

License Icon
License: MIT
TypeScript Icon
TypeScript Definitions: DefinitelyTyped
User Rating
4.6/ 5
196
Top Feedback
34Easy to Use
30Great Documentation
23Highly Customizable
GitHub Stars
34K
Weekly Downloads
3M
Last Commit
3mos ago

sinon

Test spies, stubs and mocks for JavaScript.

License Icon
License: BSD-3-Clause
TypeScript Icon
TypeScript Definitions: DefinitelyTyped
User Rating
4.0/ 5
10
Top Feedback
4Great Documentation
4Easy to Use
1Performant
GitHub Stars
9K
Weekly Downloads
4M
Last Commit
3mos ago
ama

axios-mock-adapter

Axios adapter that allows to easily mock requests

License Icon
License: MIT
TypeScript Icon
TypeScript Definitions: Built-In
User Rating
5.0/ 5
2
Top Feedback
2Easy to Use
1Great Documentation
GitHub Stars
3K
Weekly Downloads
751K
Last Commit
1mo ago
suc

suchjs

A fake data generator library, extendable, configurable,powerful, mock data as you want easily.

License Icon
License: MIT
TypeScript Icon
TypeScript Definitions: Built-In
User Rating
5.0/ 5
1
Top Feedback
1Easy to Use
1Highly Customizable
GitHub Stars
14
Weekly Downloads
125
Last Commit
3mos ago
rnf

react-native-fetch-mock

fetch mock for react-native

License Icon
License: MIT
TypeScript Icon
TypeScript Definitions: DefinitelyTyped
User Rating
5.0/ 5
1
Top Feedback
N/A
GitHub Stars
43
Weekly Downloads
234
Last Commit
7mos ago
jso

jsonplaceholder

A simple online fake REST API server

License Icon
License: MIT
TypeScript Icon
TypeScript Definitions: DefinitelyTyped
User Rating
5.0/ 5
1
Top Feedback
1Great Documentation
GitHub Stars
4K
Weekly Downloads
16
Last Commit
7mos ago
ms

mock-socket

Javascript mocking library for WebSockets and Socket.IO

License Icon
License: MIT
TypeScript Icon
TypeScript Definitions: DefinitelyTyped
User RatingN/A
Top Feedback
N/A
GitHub Stars
650
Weekly Downloads
246K
Last Commit
2mos ago
jma

jest-mock-axios

Axios mock for Jest

License Icon
License: MIT
TypeScript Icon
TypeScript Definitions: Built-In
User RatingN/A
Top Feedback
N/A
GitHub Stars
204
Weekly Downloads
90K
Last Commit
2mos ago
jlm

jest-localstorage-mock

A module to mock window.localStorage and window.sessionStorage in Jest

License Icon
License: BSD-3-Clause
TypeScript Icon
TypeScript Definitions: DefinitelyTyped
User RatingN/A
Top Feedback
N/A
GitHub Stars
282
Weekly Downloads
366K
Last Commit
4mos ago

testdouble

A minimal test double library for TDD with JavaScript

License Icon
License: MIT
TypeScript Icon
TypeScript Definitions: Built-In
User RatingN/A
Top Feedback
N/A
GitHub Stars
1K
Weekly Downloads
50K
Last Commit
3mos ago

mimic

Seamless client side mocking

License Icon
License: MIT
TypeScript Icon
TypeScript Definitions: DefinitelyTyped
User RatingN/A
Top Feedback
N/A
GitHub Stars
383
Weekly Downloads
5K
Last Commit
9mos ago
xm

xhr-mock

Utility for mocking XMLHttpRequest.

License Icon
License: MIT
TypeScript Icon
TypeScript Definitions: Built-In
User RatingN/A
Top Feedback
N/A
GitHub Stars
189
Weekly Downloads
131K
Last Commit
1yr ago
mk

mock-knex

A mock knex adapter for simulating a database during testing

License Icon
License: MIT
TypeScript Icon
TypeScript Definitions: DefinitelyTyped
User RatingN/A
Top Feedback
N/A
GitHub Stars
218
Weekly Downloads
36K
Last Commit
8mos ago

lineman

Lineman helps you build fat-client JavaScript apps. It produces happiness by building assets, mocking servers, running specs on every file change

License Icon
License: MIT
TypeScript Icon
TypeScript Definitions: DefinitelyTyped
User RatingN/A
Top Feedback
N/A
GitHub Stars
1K
Weekly Downloads
961
Last Commit
8mos ago
rj

redis-js

Mock redis in pure javascript

License Icon
License: MIT
TypeScript Icon
TypeScript Definitions: DefinitelyTyped
User RatingN/A
Top Feedback
N/A
GitHub Stars
34
Weekly Downloads
1K
Last Commit
4yrs ago

kakapo

🐦 Next generation mocking framework in Javascript

License Icon
License: MIT
TypeScript Icon
TypeScript Definitions: Built-In
User RatingN/A
Top Feedback
N/A
GitHub Stars
531
Weekly Downloads
534
Last Commit
1yr ago

service-mocker

🚀 Next generation frontend API mocking framework

License Icon
License: MIT
TypeScript Icon
TypeScript Definitions: Built-In
User RatingN/A
Top Feedback
N/A
GitHub Stars
1K
Weekly Downloads
163
Last Commit
4yrs ago