Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jhonatanmizu/snuts.js
SNUTS.js: Sniffing Nasty Unit Test Smells in Javascript
https://github.com/jhonatanmizu/snuts.js
api fastify fastify-swagger jasmine javascript jest quality smell-detector test typescript vitest
Last synced: 22 days ago
JSON representation
SNUTS.js: Sniffing Nasty Unit Test Smells in Javascript
- Host: GitHub
- URL: https://github.com/jhonatanmizu/snuts.js
- Owner: Jhonatanmizu
- License: gpl-3.0
- Created: 2024-05-10T03:21:47.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-10-07T12:12:30.000Z (29 days ago)
- Last Synced: 2024-10-14T07:41:57.304Z (22 days ago)
- Topics: api, fastify, fastify-swagger, jasmine, javascript, jest, quality, smell-detector, test, typescript, vitest
- Language: JavaScript
- Homepage:
- Size: 359 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# SNUTS.js: Sniffing Nasty Unit Test Smells in Javascript API
This API is designed to detect test smells in JavaScript codebases. It provides endpoints to analyze JavaScript test files and identify common test smells.
## Technologies Used
- Node.js
- Express.js
- JavaScript
- Yarn
- Babel
- Vitest## Setup
To run this project locally, follow these steps:
1. Clone the repository:
```sh
git clone https://github.com/Jhonatanmizu/SNUTS.js.git
```2. Install dependencies:
```sh
cd SNUTS.js
yarn
```3. Start the API server:
```sh
yarn start
```4. The API will be accessible at `http://localhost:3001`.
## Endpoints
### `POST /`
- **Description**: Detect test smells in JavaScript test files.
- **Request Body**:
- `repository`: a public github repository which have jest or jasmine.
- **Response**:
- `results`: Array of objects containing the detected test smells.### `GET /health`
- **Description**: Check the health of the API.
- **Response**:
- `status`: Status of the API (e.g., "OK").## Usage
You can use the API to detect test smells in your JavaScript test files by sending a POST request to the `/detect` endpoint with the test files you want to analyze.
Example:
```sh
curl -X POST http://localhost:3000/ -H "Content-Type: application/json" -d '{"repository":"repo-url"}'
```## Contributing
If you'd like to contribute to this project, please fork the repository and submit a pull request. You can also open an issue to report bugs or suggest new features.
---
Let me know if you need any further adjustments or additions!