@olton/latte v0.17.2
🥛 Latte
Latte (an abbreviation from laconic testing) is a testing framework designed for testing applications written in JavaScript and TypeScript.
It is designed to be straightforward to use, with a focus on speed, performance, and user information.
Latte is an alternative to other testing frameworks like Jest, Mocha, and Jasmine with the following core features:
- Config free.
- Functions for creating test cases
it,test,describe,suiteorexpect. - Setup and Teardown functions
beforeEach,afterEach,beforeAll,afterAll. - React Components testing (
jsxsyntax supported). - HTML Components testing (DOM built-in).
- Headless browser in scope
Bfor test web pages and remote saites. - Asynchronous code testing with
async/await. - Mock functions.
- Big set (100+) of built-in matchers.
- TypeScript testing out of the box. You can use both
jsandtstest files in the same project. - Simple extend
Expectclass for adding your matchers. - A lot of expects in one test case.
- Built-in coverage tool.
Verbose,WatchingandDebugmode.- Different Reporters:
lcov,console,html, andjunit. - Open source and MIT license.

Quick Reference
Installation
npm install @olton/latte -DUsage
IntelliJ plugin
You can use Latte with IntelliJ IDEA, WebStorm, PhpStorm, and other JetBrains IDEs. The plugin is available in the JetBrains Marketplace.
Command line
Create a test file with *.test.js or *.test.ts extension (for example).
You can use both of them in the same project.
function hello() {
return "Hello"
}
describe(`Common tests suite`, () => {
it(`says hello`, () => {
return expect(hello()).toBe("Hello")
})
})
test(`Bad test 2 !== 1`, () => {
return expect(2).toBe(1)
})Update package.json to run tests with latte command.
{
"scripts": {
"test": "latte"
}
}Run tests
Now you can run tests with the following command:
npm testor with npx:
npx latteFunctions
describe– create a test suiteit- create a test case in suitetest- create standalone testexpect- create assertionbeforeEach- run before each test caseafterEach- run after each test casebeforeAll- run before all test casesafterAll- run after all test casesmock- create mock function
Matchers
Latte contains a big set of built-in matchers:
- A simple comparison
- A strong comparison
- Type checking
- Number checking
- String checking
- Array checking
- Object checking
- Color checking
- IP, Email, Url checking
- JSON, XML checking
- Date, RegExp, Symbol checking
- Function checking
- HTML element checking
- and more...
TypeScript
To use Latte with TypeScript you need to install tsx package.
npm install -D tsx cross-envand then
{
"scripts": {
"test": "cross-env NODE_OPTIONS=\"--import tsx\" latte"
}
}License
Latte licensed under MIT license.
Contributing
Bug Reports & Feature Requests
Use issue tracker to report bugs or request new features.
Code Standards
Support
If you like this project, please consider supporting it by:
- Star this repository on GitHub
- Sponsor this project on GitHub Sponsors
- PayPal to
serhii@pimenov.com.ua. - Patreon
- Buy me a coffee
Copyright (c) 2025 by Serhii Pimenov
8 months ago
8 months ago
8 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago