Skip to content

Repository files navigation

🌌 bespin

A test framework engine.

CI

Goals

  • Extendable
  • Easy to understand

Architecture

Usage

Install

The first step is installing the core library and cli application

$ npm install -D @testingrequired/bespin-cli

Config File

This provides the foundation for the framework but it still needs to know how to locate test files, parse them and run them.

$ npm install -D @testingrequired/bespin-glob-test-file-locator @testingrequired/bespin-spec-test-file-parser @testingrequired/bespin-serial-runner

These will provide finding test files using a glob pattern (e.g. **/*.test.js), parse test files with a describe/it/beforeEach syntax and execute the tests in parallel.

Now create a configuration file called bespin.config.js at your project root:

const{ Config }=require("@testingrequired/bespin-core");const{
GlobTestFileLocator,}=require("@testingrequired/bespin-glob-test-file-locator");const{
SpecTestFileParse,}=require("@testingrequired/bespin-spec-test-file-parser");const{ AsyncRunner }=require("@testingrequired/bespin-async-runner");module.exports=newConfig(__filename).withLocator(newGlobTestFileLocator("**/*.test.js")).withParser(newSpecTestFileParse()).withRunner(newAsyncRunner()).withSetting("randomizeTests",true);

Write Tests

constassert=require("assert");describe("beforeEach",()=>{letbaseValue;beforeEach(()=>{baseValue=10;});it("should sum with base value",async()=>{assert.strictEqual(baseValue,10);});describe("nesting",()=>{beforeEach(()=>{baseValue++;});it("should sum with incremented base value",async()=>{assert.strictEqual(baseValue,11);});});});

Run

$ bespin

Packages

Addons

Development

Name

bespin is a working title and will change upon initial release.

About

A test framework engine

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages