lestr

0.1.2 • Public • Published

⚖️ Lestr the lil' tester

Summary

  • 🎉 0 dependencies, ~6kb
  • Blazing fast (1000 tests in ~200ms)
  • 😇 Minimal & familiar API

About

Lestr is a unit test framework I built during a weekend mostly for fun & learning.

It works surprisingly good for being a weekend project. And will probably serve your basic needs well. However, if you need snapshots or other functions, there are more mature frameworks out there.

Get started

To get it, run:

$ npm i -D lestr

Then add lestr to your npm test script

"scripts": {
  "test": "lestr"
}

Create a file named **.test.js Lestr will automatically find all files that end in .test.js

test('foo should pass', is => {
  is.passing()
})

Then run:

$ npm test

API

Please check /tests/index.test.js for some example tests.

Here's the full assertion API

passing()
failing()
equal()
true()
false()
bool()
number()
int()
date()
array()
object()
string()
promise()
function()
url()
undefined()
empty()
null()

Example tests:

test('arrays are equal?', is => {
  const match = [1, 2]
  const to = [1, 2]

  is.equal(match, to)
})

test('is url', is => {
  const url = 'https://gitlab.com/imlinus/lester'
  is.url(url)
})

MIT License

Licensed under the MIT License

Cheers

Readme

Keywords

none

Package Sidebar

Install

npm i lestr

Weekly Downloads

2

Version

0.1.2

License

MIT

Unpacked Size

10.7 kB

Total Files

14

Last publish

Collaborators

  • imlinus