Function
Static Protected Summary | ||
protected |
Wether or not nvm exists. |
|
protected |
Makes a function hookable |
|
protected |
Process a nvm shell command as a Promise. |
|
protected |
nvmInstall(version: version, config: Object, hooks: Object): Promise Install a Node version with nvm if needed |
|
protected |
Test using a Node version with nvm |
|
protected |
nvmTestVersion(version: version, config: Object, hooks: Object): Promise Run test using a Node version via nvm |
|
protected |
nvmTestVersions(versions: version[], config: Object, hooks: Object): number Run test using a list of Node versions with nvm. |
|
protected |
Spawn a shell command with nvm shell. |
Static Protected
protected exists(): boolean source
import {exists} from 'nvm-test/src/api/nvm.js'
Wether or not nvm exists.
protected hookable(fn: function): Hookable source
import {hookable} from 'nvm-test/src/api/hooks.js'
Makes a function hookable
Params:
Name | Type | Attribute | Description |
fn | function | A function to make hookable |
Throw:
When argument is not a function |
protected nvm(command: command): Promise source
import {nvm} from 'nvm-test/src/api/nvm.js'
Process a nvm shell command as a Promise.
- It will resolve on 'close' code not equals 0.
- It will reject on 'error' and 'close' code equals 0.
Params:
Name | Type | Attribute | Description |
command | command |
|
A shell command |
protected nvmInstall(version: version, config: Object, hooks: Object): Promise source
import {nvmInstall} from 'nvm-test/src/api/nvm-install.js'
Install a Node version with nvm if needed
Params:
Name | Type | Attribute | Description |
version | version |
|
A Node version to install with nvm |
config | Object |
|
A config |
config.install | {install: command} |
|
A config |
hooks | Object |
|
An Object of Hooks |
hooks.nvmHooks | {nvmHooks: Hooks} |
|
nvm Hooks |
protected nvmTest(version: version, config: Object, hooks: Object): Promise source
import {nvmTest} from 'nvm-test/src/api/nvm-test.js'
Test using a Node version with nvm
Params:
Name | Type | Attribute | Description |
version | version |
|
A Node version to use with nvm |
config | Object |
|
A config |
config.test | {test: command} |
|
A config |
config.dryRun | {dryRun: boolean} |
|
Wheter or not to dry run the test |
hooks | Object |
|
An Object of Hooks |
hooks.nvmHooks | {nvmHooks: Hooks} |
|
A nvm Hooks |
protected nvmTestVersion(version: version, config: Object, hooks: Object): Promise source
import {nvmTestVersion} from 'nvm-test/src/api/nvm-test-version.js'
Run test using a Node version via nvm
Params:
Name | Type | Attribute | Description |
version | version |
|
A Node version to use with nvm |
config | Object |
|
A config |
config.install | {install: command} |
|
A config |
config.test | {test: command} |
|
A config |
config.dryRun | {dryRun: boolean} |
|
Wheter or not to dry run the test |
hooks | Object |
|
An Object of Hooks |
hooks.nvmInstallHooks | {nvmInstallHooks: Hooks} |
|
nvmInstall Hooks |
hooks.nvmTestHooks | {nvmTestHooks: Hooks} |
|
nvmTest Hooks |
protected nvmTestVersions(versions: version[], config: Object, hooks: Object): number source
import {nvmTestVersions} from 'nvm-test/src/api/nvm-test-versions.js'
Run test using a list of Node versions with nvm.
Params:
Name | Type | Attribute | Description |
versions | version[] |
|
A list of Node versions to use with nvm |
config | Object |
|
A config |
config.install | {install: command} |
|
A config |
config.test | {test: command} |
|
A config |
config.dryRun | {dryRun: boolean} |
|
Wheter or not to dry run the test |
hooks | Object |
|
An Object of Hooks |
hooks.nvmTestVersionHooks | {nvmTestVersionHooks: Hooks} |
|
nvmTestVersion Hooks |
protected shell(command: command): ChildProcess | EventEmitter source
import {shell} from 'nvm-test/src/api/nvm.js'
Spawn a shell command with nvm shell.
Params:
Name | Type | Attribute | Description |
command | command |
|
A shell command to spawn |
Return:
ChildProcess | EventEmitter | The spawned nvm command child process |