# jest-environment-adapt

> Setup jest using jsdom. Support Adapt plugin mocking. Allow jsdom to load resources from Adapt's build output. Fix missing apis on jsdom window. Force jest to wait for Adapt to load correctly.

Latest version **1.0.1** (published 2023-09-20) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install jest-environment-adapt
pnpm add jest-environment-adapt
yarn add jest-environment-adapt
bun add jest-environment-adapt
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2023-09-20 |
| First published | 2023-09-19 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 11.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | oliver.foster |

## Links

- npm: https://www.npmjs.com/package/jest-environment-adapt
- Homepage: https://github.com/adaptlearning/jest-environment-adapt
- npm.io page: https://npm.io/package/jest-environment-adapt

## Dependencies (3)

- [jsdom](https://npm.io/package/jsdom.md) ^20.0.0
- [fs-extra](https://npm.io/package/fs-extra.md) ^8.1.0
- [jest-environment-jsdom](https://npm.io/package/jest-environment-jsdom.md) ^29.5.0

## Recent versions

- 1.0.1 (latest) — 2023-09-20
- 1.0.0 — 2023-09-19

## README

# jest-environment-adapt

Setup jest using jsdom. Support Adapt plugin mocking. Allow jsdom to load resources from Adapt's build output. Fix missing apis on jsdom window. Force jest to wait for Adapt to load correctly.

Supports loading Adapt into a node jsdom environment for unit testing.

### Config in `jest.config.json`
```json
{
  "testEnvironment": "jest-environment-adapt",
  "testEnvironmentOptions": {
    "pluginsMockFile": "./test/unit/__mocks__/plugins.js"
  }
}
```

### Programmic config
```js
  const config = require('./jest.config');
  config.testEnvironmentOptions.outputDir = "./build/";
```

---
_Source: https://npm.io/package/jest-environment-adapt · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
