# force lightning lwc test create

## Description for force lightning lwc test create

creates a Lightning web component test file with boilerplate code inside a **tests** directory.

## Flags

| Flag Name (Long) | Flag Name (Short) | Description                                                                                                                                                                                                               |
| ---------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--filepath`     | `-f`              | **Type:** Value<br>**Required**<br><br>path to Lightning web component .js file to create a test for                                                                                                                      |
| `--json`         | N/A               | **Type:** Boolean<br><br>format output as json                                                                                                                                                                            |
| `--loglevel`     | N/A               | **Type:** Value<br>**Valid Values:** `trace`, `debug`, `info`, `warn`, `error`, `fatal`, `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR`, `FATAL`<br>**Default value:** `warn`<br><br>logging level for this command invocation |

## Examples for force lightning lwc test create

```shell
sfdx force:lightning:lwc:test:create -f force-app/main/default/lwc/myButton/myButton.js
```
