Skip to content

Commit

Permalink
allow to override options (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
foxriver76 committed Dec 19, 2023
1 parent a39feee commit 734017f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ Set process.env.JS_CONTROLLER_VERSION to version e.g. `5.0.5-alpha.0-20230617-46

## Changelog
<!-- ### **WORK IN PROGRESS** -->
### **WORK IN PROGRESS
* (foxriver76) allow to specify the `rootDir`

### 1.0.5 (2023-12-15)
* (bluefox) Added support for vis-1 testing

Expand Down
20 changes: 20 additions & 0 deletions setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,25 @@ function clearDB() {
}
}

/** @typedef {{ rootDir?: string }} LegacyTestingOptions */

/**
* Override options
*
* @param {LegacyTestingOptions} options specify attributes which should be overridden
*/
function setOptions(options) {
if (options.rootDir) {
rootDir = options.rootDir
}
}

/**
* Install js-controller and setup the adapter
*
* @param {string[]} preInstalledAdapters list of adapters which need to be installed additionally
* @param {(systemConfig: Record<string, any>) => void} cb callback
*/
function setupController(preInstalledAdapters, cb) {
if (typeof preInstalledAdapters === 'function') {
cb = preInstalledAdapters;
Expand Down Expand Up @@ -960,4 +979,5 @@ if (typeof module !== undefined && module.parent) {
module.exports.installCustomAdapter = installCustomAdapter;
module.exports.getObject = getObject;
module.exports.setObject = setObject;
module.exports.setOptions = setOptions;
}

0 comments on commit 734017f

Please sign in to comment.