All Projects → fabioricali → beJS

fabioricali / beJS

Licence: other
Simple, light-weight assertions framework for javascript

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to beJS

Zunit
A powerful testing framework for ZSH projects
Stars: ✭ 140 (+1066.67%)
Mutual labels:  assertions, test-framework
Enzyme
JavaScript Testing utilities for React
Stars: ✭ 19,781 (+164741.67%)
Mutual labels:  assertions, assertion-library
Bash unit
bash unit testing enterprise edition framework for professionals
Stars: ✭ 419 (+3391.67%)
Mutual labels:  assertions, test-framework
json matcher
Library for simplifying data verification in functional tests for your JSON-based APIs
Stars: ✭ 24 (+100%)
Mutual labels:  assertions, assertion-library
tau
A Micro (1k lines of code) Unit Test Framework for C/C++
Stars: ✭ 121 (+908.33%)
Mutual labels:  assertions, test-framework
fluentcheck
Fluent assertions for Python
Stars: ✭ 79 (+558.33%)
Mutual labels:  assertions, assertion-library
jsonassert
A Go test assertion library for verifying that two representations of JSON are semantically equal
Stars: ✭ 102 (+750%)
Mutual labels:  assertions, assertion-library
tester
Lightweight test utilities to use with Go's testing package
Stars: ✭ 43 (+258.33%)
Mutual labels:  assertions, test-framework
fluent-schemer
i wrote this so i can validate stuff without suffering
Stars: ✭ 43 (+258.33%)
Mutual labels:  validation-library
oval
OVal - the object validation framework for Java
Stars: ✭ 95 (+691.67%)
Mutual labels:  validation-library
crystal-clear
Design by Contract for Crystal
Stars: ✭ 45 (+275%)
Mutual labels:  assertions
asserts
The most over-engineered and overpowered C++ assertion library.
Stars: ✭ 217 (+1708.33%)
Mutual labels:  assertions
selenified
The Selenified Test Framework provides mechanisms for simply testing applications at multiple tiers while easily integrating into DevOps build environments. Selenified provides traceable reporting for both web and API testing, wraps and extends Selenium calls to more appropriately handle testing errors, and supports testing over multiple browser…
Stars: ✭ 38 (+216.67%)
Mutual labels:  test-framework
alexa-skill-test-framework
Framework for easy offline black-box testing of Alexa skills.
Stars: ✭ 64 (+433.33%)
Mutual labels:  test-framework
Telegraf-Test
Telegraf Test - Simple Test ToolKit of Telegram Bots
Stars: ✭ 22 (+83.33%)
Mutual labels:  test-framework
jsbb
JavaScript building blocks
Stars: ✭ 31 (+158.33%)
Mutual labels:  validation-library
concise
✅ Concise is test framework for using plain English and minimal code, built on PHPUnit.
Stars: ✭ 47 (+291.67%)
Mutual labels:  assertions
IO-TESTER
A functional test framework
Stars: ✭ 32 (+166.67%)
Mutual labels:  test-framework
cxx-tap
Test Anything Protocol (TAP) Producer for C++
Stars: ✭ 22 (+83.33%)
Mutual labels:  assertions
gtest
Go test utility library inspired by pytest
Stars: ✭ 27 (+125%)
Mutual labels:  test-framework

to be, or not to be, that is the question


Simple, light-weight assertions framework for javascript

More than 190 validation methods

Installation

Node.js

npm install bejs --save

Browser

Local

<script src="node_modules/bejs/dist/be.min.js"></script>

CDN unpkg

<script src="https://unpkg.com/bejs/dist/be.min.js"></script>

CDN jsDeliver

<script src="https://cdn.jsdelivr.net/npm/bejs/dist/be.min.js"></script>

Example

const be = require('bejs');

// call a method
be.boolean(true);

// call interface "not"
be.not.boolean(1);

// call interface "all" and passing arguments
be.all.boolean(true, false, true);

// call interface "all" and passing array
be.all.boolean([true, false, true]);

// call interface "any" and passing arguments
be.any.boolean(true, false, 1);

// call interface "err" to throw an error if assertions  are not satisfied
be.err.equal('hello world', 'hello world!'); // throw AssertionError

// call interface "err" passing a custom error message
be.err('the string must be equal to "hello world!"').equal('hello world', 'hello world!'); // throw AssertionError

// call others interfaces from "err"
be.err.any.array([], {}, '');

As unit test with Mocha

describe('a test', () => {
    it('should be ok', (done)=>{
        be.err(done).email('[email protected]');
    });
    
    it('should be false', ()=>{
        be.err.false(2 === 3);
    });
});

Documentation

See https://be.js.org

Changelog

You can view the changelog here

License

beJS is open-sourced software licensed under the MIT license

Author

Fabio Ricali

Davide Polano

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].