All Projects → ealush → Vest

ealush / Vest

Licence: mit
Vest ✅ Declarative validations framework

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Vest

Qtools
QTools collection of open source tools for embedded systems development on Windows, Linux and MacOS
Stars: ✭ 64 (-94.96%)
Mutual labels:  unit-testing
Memote
memote – the genome-scale metabolic model test suite
Stars: ✭ 73 (-94.26%)
Mutual labels:  unit-testing
Sample Code Movies
This repository contains sample code. Its purpose being, to quickly demonstrate Android and software development in general, clean code, best practices, testing and all those other must know goodies.
Stars: ✭ 81 (-93.63%)
Mutual labels:  unit-testing
C koans
C Koans
Stars: ✭ 65 (-94.89%)
Mutual labels:  unit-testing
Publish Unit Test Result Action
GitHub Action to publish unit test results on GitHub
Stars: ✭ 71 (-94.41%)
Mutual labels:  unit-testing
Tcunit
An unit testing framework for Beckhoff's TwinCAT 3
Stars: ✭ 74 (-94.18%)
Mutual labels:  unit-testing
React Cool Starter
😎 🐣 A starter boilerplate for a universal web app with the best development experience and a focus on performance and best practices.
Stars: ✭ 1,083 (-14.79%)
Mutual labels:  unit-testing
Jasmine Marbles
Marble testing helpers for RxJS and Jasmine
Stars: ✭ 85 (-93.31%)
Mutual labels:  unit-testing
Aunit
Unit testing framework for Arduino platforms inspired by ArduinoUnit and Google Test. Used with AUniter or EpoxyDuino for continuous builds.
Stars: ✭ 73 (-94.26%)
Mutual labels:  unit-testing
Semaphore Ng2 Webpack
Stars: ✭ 81 (-93.63%)
Mutual labels:  unit-testing
Simplestubs
*SimpleStubs* is a simple mocking framework that supports Universal Windows Platform (UWP), .NET Core and .NET framework. SimpleStubs is currently developed and maintained by Microsoft BigPark Studios in Vancouver.
Stars: ✭ 66 (-94.81%)
Mutual labels:  unit-testing
Nager.publicsuffix
.NET publicsuffix domain parser
Stars: ✭ 67 (-94.73%)
Mutual labels:  validation-library
Go Script Bash
Framework for writing modular, discoverable, testable Bash scripts
Stars: ✭ 77 (-93.94%)
Mutual labels:  unit-testing
Redux Saga Test Plan
Test Redux Saga with an easy plan.
Stars: ✭ 1,135 (-10.7%)
Mutual labels:  unit-testing
Sequelize Test Helpers
A collection of utilities to help with unit-testing Sequelize models
Stars: ✭ 83 (-93.47%)
Mutual labels:  unit-testing
Lcformvalidation
Javascript based form validation library, third party library / framework agnostic.
Stars: ✭ 58 (-95.44%)
Mutual labels:  validation-library
Sinon
Test spies, stubs and mocks for JavaScript.
Stars: ✭ 8,828 (+594.57%)
Mutual labels:  unit-testing
Autoparams
Arbitrary test data generator for parameterized tests in Java inspired by AutoFixture.
Stars: ✭ 77 (-93.94%)
Mutual labels:  unit-testing
Android Mvp Architecture
MVP + Kotlin + Retrofit2 + Dagger2 + Coroutines + Anko + Kotlin-Android-Extensions + RX-java + Mockk + Espresso + Junit5
Stars: ✭ 82 (-93.55%)
Mutual labels:  unit-testing
Aspnetcorespa
Asp.Net 5.0 & Angular 11 SPA Fullstack application with plenty of examples. Live demo:
Stars: ✭ 1,211 (-4.72%)
Mutual labels:  unit-testing

Vest

Vest 🦺 Declarative Validation Testing

Github Stars Npm downloads

npm version Build Status Known Vulnerabilities minifiedSize

Join discord

Tutorials

Step By Step React Tutorial

Release Notes

🦺 What is Vest?

Vest is a validations library for JS apps that derives its syntax from modern JS unit testing frameworks such as Mocha or Jest. It is easy to learn due to its use of already common declarative patterns. It works great with user-input validation and with validating upon user interaction to provide the best possible user experience.

The idea behind Vest is that your validations can be described as a 'spec' or a contract that reflects your form or feature structure. Your validations run in production, and they are framework agnostic - meaning Vest works well with React, Angular, Vue, or even without a framework at all.

Using Vest for form validation can reduce bloat, improve feature readability and maintainability.

Basic Example full

Memoized async test memo

✅ Motivation

Writing forms is an integral part of building web apps, and even though it may seem trivial at first - as your feature grows over time, so does your validation logic grows in complexity.

Vest tries to remediate this by separating validation logic from feature logic so it is easier to maintain over time and refactor when needed.

✨ Vest's features

  • 🎨 Framework agnostic (BYOUI)
  • ⚡️ Rich, extendable, assertions library (enforce) (doc)
  • 🚥 Multiple validations for the same field
  • ⚠️ Warning (non failing) tests (doc)
  • 📝 Validate only the fields the user interacted with (doc)
  • ⏳ Memoize async validations to reduce calls to the server (doc)
  • 🚦 Test grouping (doc)

Example code (Run in sandbox)

import vest, { test } from 'vest';

export default vest.create('user_form', (data = {}, currentField) => {
  vest.only(currentField);

  test('username', 'Username is required', () => {
    enforce(data.username).isNotEmpty();
  });

  test('username', 'Username is too short', () => {
    enforce(data.username).longerThanOrEquals(3);
  });

  test('password', 'Password is required', () => {
    enforce(data.password).isNotEmpty();
  });

  test('password', 'Password must be at least 6 chars long', () => {
    enforce(data.password).longerThanOrEquals(6);
  });

  test('password', 'Password is weak, Maybe add a number?', () => {
    vest.warn();
    enforce(data.password).matches(/[0-9]/);
  });

  if (data.password) {
    test('confirm_password', 'Passwords do not match', () => {
      enforce(data.confirm_password).equals(data.password);
    });
  }

  test('email', 'Email Address is not valid', () => {
    enforce(data.email).isEmail();
  });

  test('tos', () => {
    enforce(data.tos).isTruthy();
  });
});

Why Vest?

  • 🧠 Vest is really easy to learn. You can take your existing knowledge of unit tests and transfer it to validations.
  • ✏️ Vest takes into account user interaction and warn only validations.
  • 🧱 Your validations are structured, making it very simple to read and write. All validation files look the same.
  • 🖇 Your validation logic is separate from your feature logic, preventing the spaghetti code that's usually involved with writing validations.
  • 🧩 Validation logic is easy to share and reuse across features.

Vest is an evolution of Passable by Fiverr.

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].