Skip to content

Quick Start

Latte is a powerful testing framework that allows you to write tests for your applications with ease. This quick start guide will help you set up Latte and run your first test.

Installation

Install Latte as a development dependency in your project. You can do this using your favorite package manager. Here are the commands for some popular package managers:

Terminal window
npm install -D @olton/latte

Add command to package.json

Add the following command to your package.json file:

package.json
{
"scripts": {
"test": "latte"
}
}

Create your first test

Create a new file named example.test.js in your project directory and add the following code:

example.test.js
function hello() {
return "Hello"
}
describe(`Common tests suite`, () => {
it(`says hello`, () => {
return expect(hello()).toBe("Hello")
})
})

Run the test

Run the following command in your terminal:

Terminal window
npm test