forky_test 0.1.2

Rust Utilities
Documentation

Forky Test

At this stage Forky is really just a proof of concept, do not use seriously!

Basically a jest clone, the forky_test crate will set you up with a beautiful test harness and intuitive matchers that are easy on the eyes.

Features

Pretty success messages

success

In progress indication

progress

Failure context

failure

Getting started

Add the following files:

Cargo.toml

[[test]]
name = "forky"
path = "tests/main.rs"
harness = false

tests/main.rs

use forky_test::*;
mod my_test;

fn main() -> Result<(), MatcherError> {
	TestRunner::run()
}

tests/my_test.rs

use forky_test::*;

describe!("my test", |s| {
	s.it("works", || {
		expect(true).to_be_false()?;

		Ok(())
	});
});

Commands

  • Run
    • cargo test --test forky
  • With watch
    • cargo watch -q -x 'test --test forky -- -w'
    • Clears terminal on each run
    • Returns an exit code zero (cleaner)
  • Specify filename
    • cargo test --test forky -- my_test