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:
npm install -D @olton/latte
pnpm -D install @olton/latte
yarn add -D @olton/latte
bun add -D @olton/latte
Add command to package.json
Add the following command to your package.json
file:
{ "scripts": { "test": "latte" }}
Create your first test
Create a new file named example.test.js
in your project directory and add the following code:
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:
npm test
pnpm test
yarn test
bun test