JavaScript

How To Test a Node.js Module with Mocha and Assert — step-by-step Javascript tutorial on Progressive Robot

How To Test a Node.js Module with Mocha and Assert

Testing is an integral part of software development. With the right test setup, this process can be automated, saving a lot of time. In this article, you’ll write tests for a Node.js TODO list module. You will set up and use the Mocha test framework to structure a series of integration tests. Then you’ll use the Node.js assert module to create the tests themselves. Finally, you will try out testing with asynchronous code, and use hooks to prepare your test fixtures and environments.

Read more
How To Use Generics in TypeScript — step-by-step Javascript tutorial on Progressive Robot

How To Use Generics in TypeScript

Generics are a fundamental feature of statically-typed languages, allowing developers to pass types as parameters to a type, function, or other structure. TypeScript fully supports generics as a way to introduce type-safety into components that accept arguments and return values whose type will be indeterminate until they are consumed later in your code. In this tutorial, you will try out real-world examples of TypeScript generics to make your code more re-usable.

Read more
How To Use Vue.js Environment Modes with a Node.js Mock Data Layer — step-by-step Javascript tutorial on Progressive Robot

How To Use Vue.js Environment Modes with a Node.js Mock Data Layer

In web development with the JavaScript framework Vue.js, developers often create the frontend of their application before the backend is ready. For a temporary backend, you can use Node.js to create a mock data layer for your application. This tutorial shows how to use environment variables to provide data for different modes of your Vue.js project.

Read more
How To Write End-to-End Tests in Node.js Using Puppeteer and Jest — step-by-step Javascript tutorial on Progressive Robot

How To Write End-to-End Tests in Node.js Using Puppeteer and Jest

End-to-end testing (e2e for short) is a process in which the entire lifecycle of an application is tested from a user’s perspective in a production-like scenario. In this tutorial, you will write an e2e test in Node.js that validates that the account creation and login features of a sample web page, using Puppeteer to crawl the site and Jest to make unit tests.

Read more
CHAT