test-bench v0.0.1-alpha.1
test-bench
test-bench is a simple command line utility that allows the casting of locally served URLs to a test bench for device testing. It is designed to abstract setup and serve project commands away from the user.
.test-bench.yaml
To run the test-bench utility, a .test-bench.yaml
file must exist within the project you're running the tool from. This file contains information about the current project, including commands to setup project dependencies/requirements and how to serve the built assets.
It also contains the location of the locally built URL, allowing this URL to be sent to the test bench for casting.
An example .test-bench.yaml
file might look like:
name: Example website
location:
path: /
port: 3000
setup:
- npm install
- npm install -g http-server
- bower install
serve: http-server -p 3000
Usage
Navigate to the project you'd like to cast, and then run:
test-bench cast
The cast command will automatically detect your current IP and broadcast this (along with fields from the .test-bench.yaml
file) to the test bench. If you'd like to manually set the host, use the --host
option:
test-bench cast --host 192.168.1.255
Configuration
By default, the host of the test bench is set to http://localhost:3000
. In reality, the test bench server will be available at a specific IP on the same network as your connected machines. To set this location, before running test-bench
use the config command:
test-bench config bench YOUR_URL_HERE
The config command will set this value within your home directory, meaning that you won't need to complete this step each time you want to run test-bench
.
If you'd like to change the bench host later on, simply run the same command to overwrite it. You can also view the current value by running:
test-bench config bench
Or restore the value to its default by running:
test-bench config --reset bench
7 years ago
7 years ago