https://github.com/luansv1495/xulin
Tool for automated architecture testing
https://github.com/luansv1495/xulin
architecture automation javascript test testing typescript
Last synced: 10 months ago
JSON representation
Tool for automated architecture testing
- Host: GitHub
- URL: https://github.com/luansv1495/xulin
- Owner: luansv1495
- License: mit
- Created: 2022-12-28T00:25:19.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-30T20:03:43.000Z (about 3 years ago)
- Last Synced: 2024-10-18T08:41:49.088Z (over 1 year ago)
- Topics: architecture, automation, javascript, test, testing, typescript
- Language: JavaScript
- Homepage:
- Size: 990 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Xulin
Architecture test automation
[](https://github.com/luansv1495/xulin/actions/workflows/ci.yml) [](https://coveralls.io/github/luansv1495/xulin?branch=main)
## Table of Contents
- [Getting Started](#getting-started)
- [Configuration](#configuration)
- [Rules](#rules)
- [License](#license)
## Getting Started
Install Xulin using [`npm`](https://www.npmjs.com/package/xulin):
```bash
npm install --save-dev xulin
```
Add the following section to your `package.json`:
```json
{
"scripts": {
"test:arch": "xulin ."
}
}
```
Before running you must create the configuration file `xulin.config.json`:
```json
{
"rules": []
}
```
Finally, run `npm run test:arch` and Xulin will print this message:
```bash
Check Suites: 0 failed, 0 skipped, 0 passed, 0 total.
Checks: 0 failed, 0 passed, 0 total.
Exec time: 00:00:00.001
```
## Configuration
### Rules
1. Check if the files in a folder do not have dependencies on the specified directories:
```json
{
"name": "no-dependencies",
"folder": "source/configs",
"folders": ["source/pages"]
}
```
2. Check that folder names in a directory follow the specified folder name:
```json
{
"name": "folder-name-in-folder",
"names": ["services", "pages", "config"],
"folder": "source"
}
```
3. Check the maximum amount of files in a directory:
```json
{
"name": "max-files-in-folder",
"quantity": 2,
"folder": "source/services"
}
```
4. Check the maximum amount of folders in a directory:
```json
{
"name": "max-folders-in-folder",
"quantity": 2,
"folder": "source/services"
}
```
5. Check the length of filenames in a directory:
```json
{
"name": "filename-size-in-folder",
"min": 3,
"max": 10,
"folder": "source"
}
```
6. Check the length of folders names in a directory:
```json
{
"name": "folder-name-size-in-folder",
"min": 3,
"max": 10,
"folder": "source"
}
```
7. Check that files in a directory follow specified patterns:
```json
{
"name": "filename-pattern-in-folder",
"patterns": ["*.ts"],
"folder": "source/services"
}
```
To skip a rule use the skip field:
```json
{
"name": "filename-pattern-in-folder",
"patterns": ["*.ts"],
"folder": "source/services",
"skip": true
}
```
## License
Xulin is [MIT licensed](./LICENSE).