All Projects → typicode → xv

typicode / xv

Licence: MIT license
❌ ✔️ zero-config test runner for simple projects

Programming Languages

javascript
184084 projects - #8 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to xv

Baretest
An extremely fast and simple JavaScript test runner.
Stars: ✭ 364 (-38.1%)
Mutual labels:  mocha, jest, tdd, minimalist
Enzyme
JavaScript Testing utilities for React
Stars: ✭ 19,781 (+3264.12%)
Mutual labels:  mocha, jest, test
Snap Shot It
Smarter snapshot utility for Mocha and BDD test runners + data-driven testing!
Stars: ✭ 138 (-76.53%)
Mutual labels:  mocha, tdd, test
Testdeck
Object oriented testing
Stars: ✭ 206 (-64.97%)
Mutual labels:  mocha, jest, tdd
Mocha
☕️ simple, flexible, fun javascript test framework for node.js & the browser
Stars: ✭ 20,986 (+3469.05%)
Mutual labels:  mocha, tdd, test
Public
Repository for wallaby.js questions and issues
Stars: ✭ 662 (+12.59%)
Mutual labels:  mocha, jest, tdd
Should Enzyme
Useful functions for testing React Components with Enzyme.
Stars: ✭ 41 (-93.03%)
Mutual labels:  mocha, tdd, test
Javascript Testing Best Practices
📗🌐 🚢 Comprehensive and exhaustive JavaScript & Node.js testing best practices (August 2021)
Stars: ✭ 13,976 (+2276.87%)
Mutual labels:  mocha, jest, test
Snap Shot
Jest-like snapshot feature for the rest of us, works magically by finding the right caller function
Stars: ✭ 170 (-71.09%)
Mutual labels:  mocha, jest, test
Nodebestpractices
✅ The Node.js best practices list (December 2021)
Stars: ✭ 72,734 (+12269.73%)
Mutual labels:  mocha, jest
chai-exclude
Exclude keys to compare from a deep equal operation with chai expect or assert.
Stars: ✭ 33 (-94.39%)
Mutual labels:  mocha, tdd
PixelTest
Fast, modern, simple iOS snapshot testing written purely in Swift.
Stars: ✭ 56 (-90.48%)
Mutual labels:  tdd, test
Nspec
A battle hardened testing framework for C# that's heavily inspired by Mocha and RSpec.
Stars: ✭ 242 (-58.84%)
Mutual labels:  mocha, tdd
Babel Plugin Tester
Utilities for testing babel plugins
Stars: ✭ 228 (-61.22%)
Mutual labels:  mocha, jest
qa-automation-base
There are basic projects for automation frameworks based on Kotlin/Java and TypeScript for the backend, frontend, and mobile.
Stars: ✭ 45 (-92.35%)
Mutual labels:  mocha, jest
framework
Lightweight, open source and magic-free framework for testing solidity smart contracts.
Stars: ✭ 36 (-93.88%)
Mutual labels:  tdd, test
mocha-cakes-2
A BDD plugin for Mocha testing framework
Stars: ✭ 44 (-92.52%)
Mutual labels:  mocha, tdd
Root Cause
🔍 Root Cause is a tool for troubleshooting Puppeteer and Playwright tests. 🔎
Stars: ✭ 205 (-65.14%)
Mutual labels:  mocha, jest
playwright-test
Run unit tests with several runners or benchmark inside real browsers with playwright.
Stars: ✭ 81 (-86.22%)
Mutual labels:  mocha, test
titef
🌠 A tiny, lightning-fast, zero-dependecies JavaScript test framework 🌠
Stars: ✭ 19 (-96.77%)
Mutual labels:  mocha, test

Node.js CI


xv

Features

  • Simple - zero-config, no API to learn, out of the box ESM/CJS support
  • Lightweight - 6kB and no dependencies
  • Magical - simply export test functions, that's all
  • Blazingly fast - with almost zero abstractions, xv is as fast as Node
  • Unix philosophy™ - do one thing well, xv is only a test runner

Used by lowdb (local JSON database), steno (fast file writer) and other awesome projects.

Install

npm install xv --save-dev

Usage

Create a test file and use Node's built-in assert module:

// src/add.test.js
import { strict as assert } from 'assert'
import add from './add.js'

// This is plain Node code, there's no xv API
export function testAdd() {
  assert.equal(add(1, 2), 3)
}

Edit package.json:

{
  "scripts": {
    "test": "xv src"
  }
}

Run all test files:

npm test

Run a single test file:

npx xv src/add.test.js 

Convention

When provided with a directory, xv will look for files named *.test.js or test.js and run exported functions sequentially.

TypeScript

To test TypeScript code, compile your .ts files and run xv on compiled .js files.

For example, assuming your compiled files are in lib/, edit package.json to run xv after tsc:

{
  "scripts": {
-   "test": "xv src"
+   "test": "tsc && xv lib"
  }
}

If you're publishing to npm, edit package.json to exclude compiled test files:

{
  "files": [
    "lib",
+   "!lib/**/*.test.js",
+   "!lib/**/test.js"
  ]
}

Common JS

xv can also test CJS code.

// src/add.test.js
const assert = require('assert').strict;
const add = require('./add')

// This is plain Node code, there's no xv API
exports.testAdd = function() {
  assert.equal(add(1, 2), 3)
}

Watch mode

xv doesn't integrate a watch mode. If the feature is needed, it's recommended to use tools like watchexec or chokidar-cli to re-run xv when there are changes.

Status

The project being very simple by design, there probably won't be frequent updates to the code (which is a good thing for you, unless you like Dependabot alerts and updating devDependencies). It will be updated to support latest Node releases and implement potential improvements.

tl;dr xv is maintained and used, even though code updates may not be recent.

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