JavaScript Testing Best Practices

Course

Online

£ 150 + VAT

Description

  • Type

    Course

  • Methodology

    Online

  • Start date

    Different dates available

Create successful test suites for frontend and backend JavaScript apps using the industry's best tools.JavaScript brings vast amounts of freedom to both frontend and backend developers. However, that freedom comes at a cost: the need to continually screen your applications for bugs and possible optimizations. The presence of multiple testing frameworks such as Jasmine and Mocha confuses newcomers and experienced JavaScript devs when it comes to deciding which one is the best tool for the job.In this course, you will delve into different aspects and specifics of JavaScript testing. You will enhance your skills by mastering many topics that have been a source of confusion in the past—such as integration testing, E2E testing, and Behavioral Driven Development. You will learn how to break down your code into systems that you can challenge individually in an isolated environment, thus catching bugs early before they reach production.With the testing skills you've acquired, you will examine the most available testing frameworks and tools (including Jasmine, Mocha, Chai, and Jest) to find the one that suits you best. Having the right tool for the job will help you work with Test-Driven and Behavioral-Driven Development on all application layers.The code bundle is available at About the Author
.
Dimitris Loukas is a software engineer and is currently part of a growing start-up building a revolutionary referral marketing platform with Node.js, Angular, MySQL, Redis, and Docker. He is also developing trading software applications using C#, Aurelia and TypeScript. He is a Packt author and has developed many video tutorials in C#, .NET Core, and TypeScript. He has worked for two start-ups in the past, is active in the open-source community, and loves taking up small side-projects. He has developed microservices using C# and Node.js and has also mastered Angular, Aurelia, and Vue.js. He is an early adopter of

Facilities

Location

Start date

Online

Start date

Different dates availableEnrolment now open

About this course

Master different testing types such as unit testing, behavioral testing, smoke testing, and more
Work with the most widespread JavaScript testing tools such as Jasmine, Mocha, and Jest
Master all Test-Driven Development best practices
Write tests in a comprehensible manner and set up the foundations for BDD
Organize and split your code in a way that allows efficient testing
Mock dependencies so you can focus on what really matters
Write a framework-agnostic, end-to-end testing suite for your frontend applications
Learn and apply industry best practices while also learning when it's necessary to break the rules of testing

Questions & Answers

Add your question

Our advisors and other users will be able to reply to you

Who would you like to address this question to?

Fill in your details to get a reply

We will only publish your name and question

Emagister S.L. (data controller) will process your data to carry out promotional activities (via email and/or phone), publish reviews, or manage incidents. You can learn about your rights and manage your preferences in the privacy policy.

Reviews

This centre's achievements

2021

All courses are up to date

The average rating is higher than 3.7

More than 50 reviews in the last 12 months

This centre has featured on Emagister for 6 years

Subjects

  • Install
  • Green
  • Private
  • Public
  • Approach
  • Javascript
  • Testing
  • Javascript training

Course programme

Best Practices of Unit Testing 6 lectures 26:15 The Course Overview This video will give you an overview about the course. Write Great Test Names Test names should be descriptive of what they do. • Use describe • Use expect Single Responsibility Principle According to the single responsibility principle, methods should do one thing. • Move functionality to separate methods • Express the single responsibility principle in your tests Covering All Test Cases Test coverage is very important. To achieve the best test coverage, we need to carefully examine every part of the code base. • Follow a step by step approach • Make sure that all errors are covered • Errors that never happen in a code flow should not be checked Improving Your Tests with a Linter Using a linter makes sure we use the same style in all test files. • Install eslint • Use a template • Lint the test files Handling and Expecting Errors Errors should be handled first and we should use assert to expect our methods to throw errors. • Replace try/catch with assert • Move checks for errors to the top of the file Best Practices of Unit Testing - Quiz Best Practices of Unit Testing 6 lectures 26:15 The Course Overview This video will give you an overview about the course. Write Great Test Names Test names should be descriptive of what they do. • Use describe • Use expect Single Responsibility Principle According to the single responsibility principle, methods should do one thing. • Move functionality to separate methods • Express the single responsibility principle in your tests Covering All Test Cases Test coverage is very important. To achieve the best test coverage, we need to carefully examine every part of the code base. • Follow a step by step approach • Make sure that all errors are covered • Errors that never happen in a code flow should not be checked Improving Your Tests with a Linter Using a linter makes sure we use the same style in all test files. • Install eslint • Use a template • Lint the test files Handling and Expecting Errors Errors should be handled first and we should use assert to expect our methods to throw errors. • Replace try/catch with assert • Move checks for errors to the top of the file Best Practices of Unit Testing - Quiz The Course Overview This video will give you an overview about the course. The Course Overview This video will give you an overview about the course. The Course Overview This video will give you an overview about the course. The Course Overview This video will give you an overview about the course. This video will give you an overview about the course. This video will give you an overview about the course. Write Great Test Names Test names should be descriptive of what they do. • Use describe • Use expect Write Great Test Names Test names should be descriptive of what they do. • Use describe • Use expect Write Great Test Names Test names should be descriptive of what they do. • Use describe • Use expect Write Great Test Names Test names should be descriptive of what they do. • Use describe • Use expect Test names should be descriptive of what they do. • Use describe • Use expect Test names should be descriptive of what they do. • Use describe • Use expect Single Responsibility Principle According to the single responsibility principle, methods should do one thing. • Move functionality to separate methods • Express the single responsibility principle in your tests Single Responsibility Principle According to the single responsibility principle, methods should do one thing. • Move functionality to separate methods • Express the single responsibility principle in your tests Single Responsibility Principle According to the single responsibility principle, methods should do one thing. • Move functionality to separate methods • Express the single responsibility principle in your tests Single Responsibility Principle According to the single responsibility principle, methods should do one thing. • Move functionality to separate methods • Express the single responsibility principle in your tests According to the single responsibility principle, methods should do one thing. • Move functionality to separate methods • Express the single responsibility principle in your tests According to the single responsibility principle, methods should do one thing. • Move functionality to separate methods • Express the single responsibility principle in your tests Covering All Test Cases Test coverage is very important. To achieve the best test coverage, we need to carefully examine every part of the code base. • Follow a step by step approach • Make sure that all errors are covered • Errors that never happen in a code flow should not be checked Covering All Test Cases Test coverage is very important. To achieve the best test coverage, we need to carefully examine every part of the code base. • Follow a step by step approach • Make sure that all errors are covered • Errors that never happen in a code flow should not be checked Covering All Test Cases Test coverage is very important. To achieve the best test coverage, we need to carefully examine every part of the code base. • Follow a step by step approach • Make sure that all errors are covered • Errors that never happen in a code flow should not be checked Covering All Test Cases Test coverage is very important. To achieve the best test coverage, we need to carefully examine every part of the code base. • Follow a step by step approach • Make sure that all errors are covered • Errors that never happen in a code flow should not be checked Test coverage is very important. To achieve the best test coverage, we need to carefully examine every part of the code base. • Follow a step by step approach • Make sure that all errors are covered • Errors that never happen in a code flow should not be checked Test coverage is very important. To achieve the best test coverage, we need to carefully examine every part of the code base. • Follow a step by step approach • Make sure that all errors are covered • Errors that never happen in a code flow should not be checked Improving Your Tests with a Linter Using a linter makes sure we use the same style in all test files. • Install eslint • Use a template • Lint the test files Improving Your Tests with a Linter Using a linter makes sure we use the same style in all test files. • Install eslint • Use a template • Lint the test files Improving Your Tests with a Linter Using a linter makes sure we use the same style in all test files. • Install eslint • Use a template • Lint the test files Improving Your Tests with a Linter Using a linter makes sure we use the same style in all test files. • Install eslint • Use a template • Lint the test files Using a linter makes sure we use the same style in all test files. • Install eslint • Use a template • Lint the test files Using a linter makes sure we use the same style in all test files. • Install eslint • Use a template • Lint the test files Handling and Expecting Errors Errors should be handled first and we should use assert to expect our methods to throw errors. • Replace try/catch with assert • Move checks for errors to the top of the file Handling and Expecting Errors Errors should be handled first and we should use assert to expect our methods to throw errors. • Replace try/catch with assert • Move checks for errors to the top of the file Handling and Expecting Errors Errors should be handled first and we should use assert to expect our methods to throw errors. • Replace try/catch with assert • Move checks for errors to the top of the file Handling and Expecting Errors Errors should be handled first and we should use assert to expect our methods to throw errors. • Replace try/catch with assert • Move checks for errors to the top of the file Errors should be handled first and we should use assert to expect our methods to throw errors. • Replace try/catch with assert • Move checks for errors to the top of the file Errors should be handled first and we should use assert to expect our methods to throw errors. • Replace try/catch with assert • Move checks for errors to the top of the file Best Practices of Unit Testing - Quiz Best Practices of Unit Testing - Quiz Best Practices of Unit Testing - Quiz Best Practices of Unit Testing - Quiz BDD Best Practices 5 lectures 27:13 Red. Green. Refactor Tests should be re-written after they fail. • Write tests without implementations • Run the tests • Build the resizer until the tests run Describing User Behavior In behavior driven development, we use describe statements to describe how our program should behave. • Use descriptive language in test names • Use describe / It Testing Only the Public API Private checks should not be tested. We should see our SUT as a black box. • Ignore private methods • Do not check for errors, that will not be exposed via the public API Using Realistic Input We need to check all possible user inputs that can cause an error. • Use undefined as a filename • Use an invalid file type Writing Plain Language Tests Cucumber allows us to write tests in plain language like English. But we have to define step definitions first. • Initialize Cucumber • Create a step definition • Write and run a feature test BDD Best Practices - Quiz BDD Best Practices. 5 lectures 27:13 Red. Green. Refactor Tests should be re-written after they fail. • Write tests without implementations • Run the tests • Build the resizer until the tests run Describing User Behavior In behavior driven development, we use describe statements to describe how our program should behave. • Use descriptive language in test names • Use describe / It Testing Only the Public API Private checks should not be tested. We should see our SUT as a black box. • Ignore private methods • Do not check for errors, that will not be exposed via the public API Using Realistic Input We need to check all possible user inputs that can cause an error. • Use undefined as a filename • Use an invalid file type Writing Plain Language Tests Cucumber allows us to write tests in plain language like English. But we have to define step definitions first. • Initialize Cucumber • Create a step definition • Write and run a feature test BDD Best Practices - Quiz Red. Green. Refactor Tests should be re-written after they fail. • Write tests without implementations • Run the tests • Build the resizer until the tests run Red. Green. Refactor Tests should be re-written after they fail. • Write tests without implementations • Run the tests • Build the resizer until the tests run Red. Green. Refactor Tests should be re-written after they fail. • Write tests without implementations • Run the tests • Build the resizer until the tests run Red. Green. Refactor Tests should be re-written after they fail. • Write tests without implementations • Run the tests • Build the resizer until the tests run Tests should be re-written after they fail. • Write tests without implementations • Run the tests • Build the resizer until the tests run Tests should be re-written after they fail. • Write tests without implementations • Run the tests • Build the resizer until the tests run Describing User Behavior In behavior driven development, we use describe statements to describe how our program should behave. • Use descriptive language in test names • Use describe / It Describing User Behavior In behavior driven development, we use describe statements to describe how our program should behave smells and avoid errors. • Download sonarqube • Download sonar scanner • Generate a...

Additional information

 Prior knowledge of JavaScript and testing is assumed

JavaScript Testing Best Practices

£ 150 + VAT