# Environment `env.codecept`

Creates configuration objects with global symbols and linter rules for E2E tests using CodeceptJS. Adds the following plugins and their recommended rules:

- [eslint-plugin-codeceptjs](https://github.com/poenneby/eslint-plugin-codeceptjs)
- [eslint-plugin-chai-expect](https://github.com/turbo87/eslint-plugin-chai-expect)

## Signature

```ts
function codecept(options: EnvCodeceptOptions): ConfigArg
```

## Options

| Name | Type | Default | Description |
| - | - | - | - |
| `basePath` | `string` | `'.'` | Path to a sub directory to apply the environment preset to. |
| `files` | `Array<string\|string[]>` | _required_ | Glob patterns for source files to be included. Use embedded arrays for AND patterns. |
| `ignores` | `string[]` | `[]` | Glob patterns for source files matching `files` to be ignored. |
| `rules` | `RulesConfig` | `{}` | Additional linter rules to be added to the configuration. |

## Example

```ts
// eslint.config.ts
import { defineConfig, env } from '@open-xchange/linter-presets/eslint'

export default defineConfig(

  // project configuration options
  { /* ... */ },

  // CodeceptJS environment
  env.codecept({
    files: ['e2e/**/*.{js,ts}'],
    rules: { /* ... */ },
  }),
)
```
