Skip to content

Commit

Permalink
Doc: Mention npm-run shortcut use case for environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
Krinkle committed Jul 18, 2024
1 parent d871f85 commit 428f8f3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/api/config/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,19 @@ Or:
qunit_config_filter=foo qunit_config_testtimeout=1000 qunit test.js
```

The environment variables can also make it easy to pass a parameter to QUnit from a child or nested command. For example, if you have several `npm run` shortcuts in `package.json`, like so:

```json
{
"scripts": {
"test-something": "qunit_config_filter=something npm run test",
"test": "npm run lint && qunit",
"lint": "eslint --cache .",
"lint-fix": "eslint --cache --fix ."
}
}
```

Configuration options that are read-only, internal/undocumented, or that require an object value (such as [`QUnit.config.storage`](./storage.md)) cannot be set via environment variables. Options that require an array of strings will be converted to an array holding the given string.

### Object preconfig
Expand Down

0 comments on commit 428f8f3

Please sign in to comment.