Emulator
Flow Javascript Testing Framework exposes emulator
singleton allowing you to run and stop emulator instance
programmatically. There are two methods available on it.
emulator.start(options)
Starts emulator on random available port, unless overriden in options. Returns Promise.
Arguments
Name | Type | Optional | Description |
---|---|---|---|
options | EmulatorOptions | ✅ | an object containing options for starting the emulator |
EmulatorOptions
Key | Type | Optional | Description |
---|---|---|---|
logging | boolean | ✅ | whether log messages from emulator shall be added to the output (default: false) |
flags | string | ✅ | custom command-line flags to supply to the emulator (default: "") |
adminPort | number | ✅ | override the port which the emulator will run the admin server on (default: auto) |
restPort | number | ✅ | override the port which the emulator will run the REST server on (default: auto) |
grpcPort | number | ✅ | override the port which the emulator will run the GRPC server on (default: auto) |
debuggerPort | number | ✅ | override the port which the emulator will run the debug server on (default: auto) |
Returns
Type | Description |
---|---|
Promise | Promise, which resolves to true if emulator started successfully |
Usage
emulator.stop()
Stops emulator instance. Returns Promise.
Arguments
This method does not expect any arguments.
Usage
emulator.setLogging(newState)
Set logging flag on emulator, allowing to temporally enable/disable logging.
Arguments
Name | Type | Description |
---|---|---|
newState | boolean | Enable/disable logging |
Usage