4

Learn all about Testing in Javascript|| 2021

 2 years ago
source link: https://medium.com/tkssharma/learn-all-about-testing-in-javascript-2021-2007d1ed0049
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Learn all about Testing in Javascript|| 2021

Javascript Testing is covered by different tools and libraries from a different framework, You might have seen jest and mocha as one the most popular testing framework and chai as an assertion library

In this blog, we will talk about all different libraries and technologies involved in covering all different kind of testing like

  • unit-testing
  • API testing or e2e testing
  • functional testing on headless browser
  • manual testing/ black box testing etc tec

All these kind of testing is covered using some of the other library, simple libraries like jasmine, mocha, chai, and Sinon

In this playlist, I have a plan to cover each and every type of testing with different framework starting from unit testing using mocha and chai, further moving to jest for testing anything in javascript

Test Tools Types [LIST]

Test tools can be divided into the following functionalities. Some provide us with only one functionality, and some provide us with a combination.

const tools = [
Karma, Jasmine, Jest, TestCafe, Cypress, webdriverio,
Mocha, Jasmine, Jest, Cucumber, TestCafe, Cypress,
Sinon, Jasmine, enzyme, Jest, testdouble,
Istanbul, Jest, Blanket,
Nightwatch, Nightmare, Phantom, Puppeteer, TestCafe, Cypress
]
  • To achieve the most flexible set functionality, it’s common to use a combination of several tools. Test launchers are used to launch your tests in the browser or Node.js with user-config. (Karma, Jasmine, Jest, TestCafe, Cypress, webdriverio)
  • Testing structure providers help you arrange your tests in a readable and scalable way. (Mocha, Jasmine, Jest, Cucumber, TestCafe, Cypress)
  • Assertion functions are used to check if a test returns what you expect it to return and if its’t it throws a clear exception. (Chai, Jasmine, Jest, Unexpected, TestCafe, Cypress) Generate and display test progress and summary. (Mocha, Jasmine, Jest, Karma, TestCafe, Cypress)
  • Mocks, spies, and stubs to simulate tests scenarios, isolate the tested part of the software from other parts, and attach to processes to see they work as expected. (Sinon, Jasmine, enzyme, Jest, testdouble)
  • Generate and compare snapshots to make sure changes to data structures from previous test runs are intended by the user’s code changes. (Jest, Ava) Generate code coverage reports of how much of your code is covered by tests. (Istanbul, Jest, Blanket)
  • Browser Controllers simulate user actions for Functional Tests. (Nightwatch, Nightmare, Phantom, Puppeteer, TestCafe, Cypress)
  • Visual Regression Tools are used to compare your site to its previous versions visually by using image comparison techniques. (Applitools, Percy, Wraith, WebdriverCSS)

Now How can we learn all these

  • i am covering playlist to cover all these in one playlist
  • unit-testing using mocha, chai, assertion, and spies library
  • functional testing using cypress end to end testing of a functional feature on the browser
  • E2E testing is an end to end API testing for the application by making actual system calls

We will discuss testing in a different type of frameworks

  • Testing with angular using karma runner
  • Testing in angular using angular test library
  • Testing in simple express application unit/integration using mocha and chai
  • Testing in React or Vue JS Application using Jest as runner and test libraries
  • Application testing using Cypress for e2e functional feature test which will run application headless browser

Libraries we are going to Use

Reference

Conclusion:

To learn more check out my YouTube Playlist covering everything about testing in javascript.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK