Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ashishk1331/test-titles
Generate semantic titles for test cases.
https://github.com/ashishk1331/test-titles
Last synced: about 1 month ago
JSON representation
Generate semantic titles for test cases.
- Host: GitHub
- URL: https://github.com/ashishk1331/test-titles
- Owner: ashishk1331
- License: mit
- Created: 2024-09-24T14:20:27.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-09-27T20:26:47.000Z (3 months ago)
- Last Synced: 2024-11-06T12:49:07.655Z (about 2 months ago)
- Language: TypeScript
- Size: 154 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
![Banner for test titles.](banner.jpg)
# Test Titles
A simple formatting-language-based string generator to produce more vivid and practical test titles for your next project.
## Features:
1. Simple to use
2. 0 dependencies
3. Easy to learn and set up## Core Philosophy
| Symbol | Element | Color | Purpose |
| ------ | ------- | ------- | -------- |
| \. | Meta | Yellow | Classify |
| \# | Topic | Magenta | Identify |
| | Title | White | Text |
| \* | Args | Red | Modifier |1. You can use more than one meta element; they function like classes assigned to an HTML element.
2. However, you can only add a single topic name to each title, which behaves like an ID assigned to an HTML element.
3. You can also add any number of arguments to the title, which are similar to the arguments passed to a function.
4. Every other word without any symbol prefixed to it will be regarded as text for the title.## Usage
1. Install the package
```sh
npm i -D @hugekontrast/test-titles
```2. Use the `t` function in your test blocks for the colorful test titles.
```js
// sum.test.js
import { expect, test } from "vitest";
import { sum } from "./sum.js";
import { t } from "@hugekontrast/test-titles";test(t("#addition 1 + 2 to equal 3"), () => {
expect(sum(1, 2)).toBe(3);
});
```