0.2.0 • Published 2 years ago

bocker v0.2.0

Weekly downloads
-
License
Unlicense
Repository
github
Last release
2 years ago

Bocker

CircleCI NPM

Bocker is a simple mocker for bats.

Installation

Npm

Install bocker with npm.

npm install -D bocker

Usage

See examples for examples.

Setup

Load bocker in the test file.

load bocker

Cleanup

Clean up the temporary files used during the test run by adding bock_teardown to the test teardown method.

function teardown() {
    bock_teardown
}

Arrange

Sets up a mock of a call.

arrange [options] call [arguments] -- [does]

Options

Options applied to the mock.

OptionDescription

Arguments

A list of arguments and/or conditions use to match the call

anyargs

Matches any remaining arguments.

any

Matches any argument.

has

Matches a sequence of arguments in the call.

# usage
has[-sequence count] sequence

# examples
has foo
has-1 foo
has-2 foo bar

Does

What the mocked call will do when executed.

Verify

Verifies a mock was run or not.

verify [options] call [arguments]
0.2.0

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago