We may earn an affiliate commission when you visit our partners.
Nate Taylor

SinonJS is one of the most popular JavaScript libraries for test doubles. This course walks through the various features of SinonJS so that you know not only how to use each feature, but more importantly, why you would use each one.

Read more

SinonJS is one of the most popular JavaScript libraries for test doubles. This course walks through the various features of SinonJS so that you know not only how to use each feature, but more importantly, why you would use each one.

Unit testing can be hard, particularly when you're testing against live systems. Data from databases can change, APIs can be down, and accessing file systems can be slow. Using test doubles in your unit tests can help alleviate a lot of the struggles and issues you might experience. In this course, SinonJS Fundamentals, you'll learn how the SinonJS library can help make unit testing easier and more repeatable. First, you'll explore each of the test doubles that Sinon offers. Not only will you learn the syntax, but with the hands-on demos, you'll see how and when to use each test double. Next, you'll delve into other utilities that Sinon offers that simplify checking that the right data was returned. Then, you'll discover how Sinon can help you even with the hard problems of testing, such as faking out dates or XHR data in the browser. Finally, you'll learn how the Sinon ecosystem works to make it easier for you to stay on top of all of your test doubles. By the end of the course, you'll be able to incorporate Sinon into your projects to ensure quick, repeatable test results.

Enroll now

Here's a deal for you

We found an offer that may be relevant to this course.
Save money when you learn. All coupon codes, vouchers, and discounts are applied automatically unless otherwise noted.

What's inside

Syllabus

Course Overview
The State of Testing at Globomantics
Spying on Functions
Swapping a Stub for a Function
Read more
Verifying Behavior with Mocks
Controlling How Parameters Are Matched
Faking out XHR and Timer Calls
Easier Set up and Clean up with Sandboxes
What’s Next?

Good to know

Know what's good
, what to watch for
, and possible dealbreakers
Introduces the fundamentals and concepts of SinonJS for test doubles
Tailored for individuals seeking to enhance their unit testing abilities
Taught by Nate Taylor, an experienced instructor in this topic
Provides hands-on demonstrations to enhance understanding and practical application
Helps learners mitigate common challenges associated with unit testing
Covers essential skills, such as spying on functions and swapping stubs

Save this course

Save SinonJS Fundamentals to your list so you can find it easily later:
Save

Activities

Be better prepared before your course. Deepen your understanding during and after it. Supplement your coursework and achieve mastery of the topics covered in SinonJS Fundamentals with these activities:
Follow the SinonJS tutorial series
The SinonJS tutorial series will provide you with a step-by-step guide to using SinonJS
Show steps
  • Find the SinonJS tutorial series
  • Follow the tutorials
Discuss different SinonJS concepts with a study group
Discussing SinonJS concepts with others will help you to understand them more deeply
Show steps
  • Find a study group
  • Discuss different SinonJS concepts
Create unit tests
Writing unit tests will help you to deeply understand the behavior of the code you are writing
Browse courses on Unit Testing
Show steps
  • Identify the code you want to test
  • Create a test file
  • Write test cases
  • Run the tests
Five other activities
Expand to see all activities and additional details
Show all eight activities
Practice Spying on Functions
Learning how spying works will help you to easily debug your code
Browse courses on Spies
Show steps
  • Setup a simple function to spy on
  • Create a spy for the function
  • Call the function and assert the spy was called
Practice Swapping a Stub for a Function
Stubbing out functions will help you to isolate and test specific parts of your code
Browse courses on Stubs
Show steps
  • Setup a simple function to stub out
  • Create a stub for the function
  • Call the function and assert the stub was called
Practice Verifying Behavior with Mocks
Using mocks will allow you to test behavior of code that you do not have direct access to
Browse courses on Mocks
Show steps
  • Setup a simple function to mock
  • Create a mock for the function
  • Call the function and assert the mock was called
Create a small project
The creation of a small project will help you to apply the concepts you are learning in a more realistic setting
Browse courses on Unit Testing
Show steps
  • Choose a project idea
  • Design and implement the project
  • Write unit tests for your project
  • Evaluate your results
Contribute to the SinonJS project
Contributing to the SinonJS project will help you to learn more about how SinonJS works and how to use it effectively
Show steps
  • Find the SinonJS project on GitHub
  • Find an issue or feature to work on
  • Create a pull request

Career center

Learners who complete SinonJS Fundamentals will develop knowledge and skills that may be useful to these careers:
Software Tester
Software Testers are responsible for identifying bugs and defects in software before it is released to the public. They need to be able to think critically and creatively in order to come up with different ways to test software. SinonJS can help Software Testers by providing them with the tools they need to create test doubles, which can be used to simulate the behavior of other systems. This can help Software Testers to identify bugs and defects that may not be immediately apparent.
Software Developer
Software Developers are responsible for designing, developing, and maintaining software applications. They need to have a strong understanding of programming languages and software development tools. SinonJS can help Software Developers by providing them with the tools they need to create unit tests for their code. Unit tests can help Software Developers to identify bugs and defects in their code before they are released to the public.
Test Engineer
Test Engineers are responsible for developing and executing test plans for software products. They need to have a strong understanding of testing methodologies and tools. SinonJS can help Test Engineers by providing them with the tools they need to create test doubles, which can be used to simulate the behavior of other systems. This can help Test Engineers to develop and execute test plans that are more effective.
Quality Assurance Analyst
Quality Assurance Analysts are responsible for ensuring that software products meet the required quality standards. They need to be able to identify and report defects in software products. SinonJS can help Quality Assurance Analysts by providing them with the tools they need to create test doubles, which can be used to simulate the behavior of other systems. This can help Quality Assurance Analysts to identify defects in software products that may not be immediately apparent.
Product Manager
Product Managers are responsible for defining the vision and roadmap for software products. They need to have a strong understanding of the market and the needs of users. SinonJS can help Product Managers by providing them with the tools they need to create test doubles, which can be used to simulate the behavior of other systems. This can help Product Managers to define the vision and roadmap for software products that are more likely to meet the needs of users.
Project Manager
Project Managers are responsible for planning and executing software development projects. They need to have a strong understanding of project management methodologies and tools. SinonJS can help Project Managers by providing them with the tools they need to create test doubles, which can be used to simulate the behavior of other systems. This can help Project Managers to plan and execute software development projects that are more likely to be successful.
Business Analyst
Business Analysts are responsible for gathering and analyzing business requirements. They need to have a strong understanding of business processes and the needs of users. SinonJS can help Business Analysts by providing them with the tools they need to create test doubles, which can be used to simulate the behavior of other systems. This can help Business Analysts to gather and analyze business requirements that are more likely to meet the needs of users.
Data Analyst
Data Analysts are responsible for collecting, analyzing, and interpreting data. They need to have a strong understanding of data analysis techniques and tools. SinonJS can help Data Analysts by providing them with the tools they need to create test doubles, which can be used to simulate the behavior of other systems. This can help Data Analysts to collect, analyze, and interpret data that is more likely to be accurate and reliable.
User Experience Designer
User Experience Designers are responsible for designing the user interface for software products. They need to have a strong understanding of user behavior and design principles. SinonJS can help User Experience Designers by providing them with the tools they need to create test doubles, which can be used to simulate the behavior of other systems. This can help User Experience Designers to design user interfaces that are more likely to be usable and enjoyable.
Systems Analyst
Systems Analysts are responsible for analyzing and designing business systems. They need to have a strong understanding of business processes and technology. SinonJS can help Systems Analysts by providing them with the tools they need to create test doubles, which can be used to simulate the behavior of other systems. This can help Systems Analysts to analyze and design business systems that are more likely to be efficient and effective.
Information Security Analyst
Information Security Analysts are responsible for protecting computer systems and networks from unauthorized access. They need to have a strong understanding of security principles and tools. SinonJS can help Information Security Analysts by providing them with the tools they need to create test doubles, which can be used to simulate the behavior of other systems. This can help Information Security Analysts to protect computer systems and networks from unauthorized access.
Quality Control Analyst
Quality Control Analysts are responsible for ensuring that products meet quality standards. They need to have a strong understanding of quality control principles and tools. SinonJS can help Quality Control Analysts by providing them with the tools they need to create test doubles, which can be used to simulate the behavior of other systems. This can help Quality Control Analysts to ensure that products meet quality standards.
Network Administrator
Network Administrators are responsible for managing and maintaining computer networks. They need to have a strong understanding of network protocols and tools. SinonJS can help Network Administrators by providing them with the tools they need to create test doubles, which can be used to simulate the behavior of other systems. This can help Network Administrators to manage and maintain computer networks that are more likely to be reliable and efficient.
Database Administrator
Database Administrators are responsible for managing and maintaining databases. They need to have a strong understanding of database management systems and tools. SinonJS can help Database Administrators by providing them with the tools they need to create test doubles, which can be used to simulate the behavior of other systems. This can help Database Administrators to manage and maintain databases that are more likely to be reliable and efficient.
Computer Systems Analyst
Computer Systems Analysts are responsible for analyzing and designing computer systems. They need to have a strong understanding of computer hardware and software. SinonJS can help Computer Systems Analysts by providing them with the tools they need to create test doubles, which can be used to simulate the behavior of other systems. This can help Computer Systems Analysts to analyze and design computer systems that are more likely to be efficient and effective.

Reading list

We've selected seven books that we think will supplement your learning. Use these to develop background knowledge, enrich your coursework, and gain a deeper understanding of the topics covered in SinonJS Fundamentals.
Provides a comprehensive overview of SinonJS, including its features, syntax, and best practices. It valuable resource for anyone who wants to learn more about SinonJS and how to use it effectively.
Provides a comprehensive guide to test-driven development (TDD) in JavaScript. It covers everything from writing effective unit tests to testing complex applications.
Provides a comprehensive overview of JavaScript testing. It covers everything from unit testing to performance testing.
Provides a comprehensive guide to unit testing. It covers everything from designing effective test cases to running and debugging tests.
Provides a comprehensive guide to test-driven development (TDD). It covers everything from writing effective unit tests to testing complex applications.
Provides a practical guide to writing testable code. It covers everything from designing testable classes to writing effective test cases.
Provides a comprehensive guide to unit testing. It covers everything from writing effective unit tests to running and debugging tests.

Share

Help others find this course page by sharing it with your friends and followers:

Similar courses

Here are nine courses similar to SinonJS Fundamentals.
ICAgile (ICP-PRG): Automated Testing
Most relevant
Unit Testing and Test Driven Development in Python
Most relevant
Learn Unit Testing with NUnit and C#
Most relevant
Unit testing your Javascript with jasmine
Most relevant
Unit Testing Legacy Code in Java SE 8
Most relevant
Introduction to Software Testing
Using H2 1 in Your Java Applications: Getting Started
Writing Testable Code
Unit Testing for Typescript & NodeJs Developers with Jest
Our mission

OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.

Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.

Find this site helpful? Tell a friend about us.

Affiliate disclosure

We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.

Your purchases help us maintain our catalog and keep our servers humming without ads.

Thank you for supporting OpenCourser.

© 2016 - 2024 OpenCourser