1.1.2 โ€ข Published 4 months ago

lovecraft v1.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

Lovecraft Test Framework ๐Ÿ™

A dark and eldritch test framework, powered by the ancient tomes of Mocha, Chai, Sinon, and c8.

Features ๐Ÿง 

  • Re-exports all functions and assertions from the chai module, allowing you to use them directly in your tests.
  • Re-exports all functions from the sinon module, providing powerful mocking and stubbing capabilities.
  • Exposes a CLI command lovecraft that can be used to run your tests, with optional linting and coverage reporting.

Usage ๐Ÿช„

Import the Lovecraft framework into your project:

import lovecraft from 'lovecraft';

const { expect, stub } = lovecraft;

// Use the imported test utilities in your code

The lovecraft module provides a default export that can be used to run tests, lint your code, and generate coverage reports. The available command-line options are:

Test ๐Ÿงช

  • lovecraft or lovecraft -t or lovecraft --test: Runs all tests found in **/*.test.js files.

Coverage ๐Ÿ“Š

  • lovecraft -c or lovecraft --coverage: Runs tests with coverage reporting.

Lint ๐Ÿงน

  • lovecraft -l or lovecraft --lint: Runs ESLint on your code.

Publish ๐Ÿš€

  • lovecraft -p or lovecraft --publish: Bumps the version, then tags and publishes the package.
  • lovecraft -p minor or lovecraft --publish minor: As above, but increments the minor version.
  • lovecraft -p major or lovecraft --publish major: As above, but increments the major version.

When using the --publish option, Lovecraft will run all the other checks (test, lint, coverage) first. The package will only be published if all the checks pass successfully. This can be used to prevent the accidental publication of a package with failing tests or linting issues.

All ๐Ÿ”ฎ

  • lovecraft -a or lovecraft --all: Runs tests, generates coverage, and lints the code.

Note that "all" means "all checks" in this context; it does not publish the package. However, lovecraft --all --publish is a great way to ensure that all checks pass before publishing the package.

Conventions ๐Ÿ•ธ๏ธ

Lovecraft assumes that your test files follow the convention of being named *.test.js and located alongside the code they are testing. This allows the CLI command to easily find and run the appropriate tests.

The Lovecraft framework also includes a default ESLint configuration file (eslint.config.js) that can be used to ensure consistent code style and quality.

If you have any other questions or need further assistance, please don't hesitate to reach out to the dark masters of Phantomaton AI. ๐Ÿ™

1.1.0

8 months ago

1.1.2

4 months ago

1.0.3

9 months ago

1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago

0.0.2

7 years ago

0.0.1

7 years ago