# @syntest/search-javascript

> SynTest JavaScript is a tool for automatically generating test cases for the JavaScript language

Latest version **0.1.0** (published 2023-09-19) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @syntest/search-javascript
pnpm add @syntest/search-javascript
yarn add @syntest/search-javascript
bun add @syntest/search-javascript
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2023-09-19 |
| First published | 2023-05-25 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=10.24.0 |
| Dependencies | 18 |
| Unpacked size | 440.4 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 5 |
| Maintainers | syntest-ci, dstallenberg, apanichella, mitchellolsthoorn |
| Keywords | syntest, automatic-test-generation |

## Links

- npm: https://www.npmjs.com/package/@syntest/search-javascript
- Repository: https://github.com/syntest-framework/syntest-javascript
- Homepage: https://www.syntest.org
- Issues: https://github.com/syntest-framework/syntest-javascript/issues
- npm.io page: https://npm.io/package/@syntest/search-javascript

## Dependencies (18)

- [chai](https://npm.io/package/chai.md) 4.3.7
- [mocha](https://npm.io/package/mocha.md) 10.2.0
- [@babel/core](https://npm.io/package/@babel/core.md) 7.20.12
- [@syntest/cfg](https://npm.io/package/@syntest/cfg.md) ^0.4.0
- [@syntest/prng](https://npm.io/package/@syntest/prng.md) ^0.1.1
- [@babel/register](https://npm.io/package/@babel/register.md) 7.18.9
- [@syntest/search](https://npm.io/package/@syntest/search.md) ^0.4.0
- [@babel/generator](https://npm.io/package/@babel/generator.md) ^7.21.9
- [@syntest/logging](https://npm.io/package/@syntest/logging.md) ^0.1.1
- [@syntest/storage](https://npm.io/package/@syntest/storage.md) ^0.2.0
- [chai-as-promised](https://npm.io/package/chai-as-promised.md) 7.1.1
- [lodash.clonedeep](https://npm.io/package/lodash.clonedeep.md) 4.5.0
- [@babel/preset-env](https://npm.io/package/@babel/preset-env.md) 7.19.1
- [@syntest/analysis](https://npm.io/package/@syntest/analysis.md) ^0.2.0
- [regenerator-runtime](https://npm.io/package/regenerator-runtime.md) 0.13.9
- [@syntest/analysis-javascript](https://npm.io/package/@syntest/analysis-javascript.md) *
- [@syntest/ast-visitor-javascript](https://npm.io/package/@syntest/ast-visitor-javascript.md) *
- [@syntest/instrumentation-javascript](https://npm.io/package/@syntest/instrumentation-javascript.md) *

## Recent versions

- 0.1.0 (latest) — 2023-09-19
- 0.2.0-beta.22 (beta) — 2024-04-19
- 0.2.0-beta.21 — 2024-04-02
- 0.2.0-beta.20 — 2024-03-25
- 0.2.0-beta.19 — 2024-03-25
- 0.2.0-beta.18 — 2024-03-04
- 0.2.0-beta.17 — 2024-03-01
- 0.2.0-beta.16 — 2024-02-24
- 0.2.0-beta.15 — 2023-12-11
- 0.2.0-beta.14 — 2023-12-11
- 0.2.0-beta.13 — 2023-12-11
- 0.2.0-beta.12 — 2023-12-11
- 0.2.0-beta.11 — 2023-12-11
- 0.2.0-beta.10 — 2023-12-11
- 0.2.0-beta.9 — 2023-12-11
- … 30 more at https://npm.io/package/@syntest/search-javascript/versions

## README

# SynTest Framework - JavaScript

> The aim of this tool is make it easier for JavaScript developers to test their code in a more effective and efficient way.

A tool to generate synthetic tests for the JavaScript language

### What is SynTest JavaScript?

SynTest JavaScript is a tool for automatically generating test cases for the JavaScript language. This tool is part of the [SynTest Framework](https://www.syntest.org). This framework contains multiple tools related to the generation of synthetic tests.

### Overview

The common core contains the common interfaces for the code control-flow representation, test case structure, genes, and the implementation for the meta-heuristic search algorithms.

## Installation

#### NPM

The simplest way to use syntest-javascript is by installing the [npm package](https://www.npmjs.com/package/syntest/javascript).

```bash
$ npm install @syntest/javascript
```

You can install it in your project as shown in the snippit above or you can install the package globally by using the npm options `-g`.

#### From source

The tool can be used by cloning the project, installing its dependencies, and compiling the TypeScript:

- Clone the projects

```bash
$ git clone git@github.com:syntest-framework/syntest-javascript.git
```

- Install dependencies

```bash
$ cd syntest-javascript; npm install
```

- Build Syntest-javascript

```bash
$ cd syntest-javascript; npm run build
```

You can create a `.syntest.js` file to change the way the tool behaves.

Finally run the tool

```bash
cd <PATH_TO_SYNTEST_JAVASCRIPT>; npm run standalone
```

The results can be found in the `syntest` folder

## Usage

To start you need to be in the root of the project folder containing the code you want to create test-cases for. Next, you need to install two dev-dependencies in your project, namely [chai](https://www.npmjs.com/package/chai) and [chai-as-promised](https://www.npmjs.com/package/chai-as-promised). Both are needed to run the tests.

After installing these dependencies together with the tool, you can run the following example command.

```bash
$ syntest-javascript --target-root-directory="<PATH_TO_YOUR_SOURCE_FOLDER>/src" --total-time=10
```

This will test all javascript code that is contained in the source folder. It will run for 10 seconds.

SynTest-JavaScript is highly configurable and supports a bunch of options and arguments, all of them can be found by providing the `--help` option or `-h` for short. Another way of configuring the tool is by putting a .syntest.js file in the root of your project. The file should have the following structure:

```js
module.exports = {
    "population-size": 10,
    "max-depth": 5,
    ...
}
```

## Documentation

For questions and help with how to use this tool, please see the [documentation](https://www.syntest.org).

## Support

For questions and help with how to use this library, please see [SUPPORT.md](SUPPORT.md).

## Contributing

Contributions are welcome! For major changes, please open an issue first to discuss what you would like to change. For more information, please see [CONTRIBUTING.md](CONTRIBUTING.md).

## Authors and acknowledgment

- Annibale Panichella (PI)
- Mitchell Olsthoorn (Project Lead)
- Dimitri Stallenberg (Developer)

## License

The code within this project is licensed under the [Apache-2.0 license](LICENSE).

---
_Source: https://npm.io/package/@syntest/search-javascript · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
