> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.doc-detective.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.doc-detective.com/_mcp/server.

# Explore sample tests

Use the sample test files provided to experiment with Doc Detective's capabilities and see how it handles different scenarios.

## Get sample files

To get a few samples, [view the samples on GitHub](https://github.com/doc-detective/doc-detective/tree/main/samples) or clone the repo and navigate to the `samples` directory:

```bash
git clone https://github.com/doc-detective/doc-detective.git
cd doc-detective/samples
npm i
```

## Run tests

#### NPX

```bash
npx doc-detective
```

#### Docker

```bash
docker run -v .:/app docdetective/docdetective
```

> **Note**
>
> The `-v` argument mounts your current directory (`.`) to `/app` in the container, giving Doc Detective access to your test specifications.

By default, Doc Detective scans the current directory for valid tests, but you can specify your test file with the `--input` argument. For example, to run tests in a file named `doc-content-inline-tests.md`, run the following command:

#### NPX

```bash
npx doc-detective --input doc-content-inline-tests.md
```

#### Docker

```bash
docker run -v .:/app docdetective/docdetective --input /app/doc-content-inline-tests.md
```

If you have test files in multiple directories or want to specify multiple files, enter them separated with commas:

#### NPX

```bash
npx doc-detective --input doc-content-inline-tests.md,/apis/api-tests.md
```

#### Docker

```bash
docker run -v .:/app docdetective/docdetective --input /app/doc-content-inline-tests.md,/app/apis/api-tests.md
```

To customize your test, file type, and directory options, create a `.doc-detective.json` [config](/reference/schemas/config) file. If a `.doc-detective.json` file exists in the directory when you run the command, Doc Detective loads the config. Otherwise, you can specify a config path with the `--config` argument.

#### NPX

```bash
npx doc-detective --config .doc-detective.json
```

#### Docker

```bash
docker run -v .:/app docdetective/docdetective --config /app/.doc-detective.json
```

**Note**: By default, paths inside a config file resolve relative to the config file's location, not the current working directory. This is controlled by [`relativePathBase`](/reference/schemas/config), which defaults to `file`; set it to `cwd` to resolve config paths relative to the current working directory instead. Paths passed on the command line with `--input`, `--output`, or `--config` always resolve relative to the current working directory.

You can override config options with command-line arguments. For example, to run tests in a file named `tests.spec.json`, even if that isn't included in your config, run the following command:

#### NPX

```bash
npx doc-detective --config .doc-detective.json --input tests.spec.json
```

#### Docker

```bash
docker run -v .:/app docdetective/docdetective --config /app/.doc-detective.json --input /app/tests.spec.json
```

### Remotely hosted tests

You can run tests hosted remotely by specifying the URL of the test file with the `--input` argument. For example, to run tests from a file hosted at `https://doc-detective.com/sample.spec.json`, run the following command:

#### NPX

```bash
npx doc-detective --input https://doc-detective.com/sample.spec.json
```

#### Docker

```bash
docker run docdetective/docdetective --input https://doc-detective.com/sample.spec.json
```

> **Note**
>
> The `-v` argument is not necessary for remotely hosted tests since Docker doesn't need access to local files.

These tests run the same way as local tests. Doc Detective fetches the test file from the specified URL and stores it in a temporary directory. The URL must be accessible to the machine running the tests.

## Next steps

* [Resources](/support/support/resources)