
Security News
npm ‘is’ Package Hijacked in Expanding Supply Chain Attack
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
Automate client-side unit testing in real browsers using the CLI
Install the module with: npm install -g bunyip
. This is a CLI tool so it needs to be globally installed.
In order for bunyip to flex its real muscle I recommend you get a paid BrowserStack account as all paid accounts have access to their API. Without the API you'll need to connect your own slave browsers to bunyip.
If you wish to test on devices that are not part of your local network you'll be required to setup a tunneling service. I recommend pagekite as it gives you a nice free chunk of data and allows you to specify a reusable subdomain. Showoff.io is another good option.
If you don't wish to use BrowserStack or a localhost sharing service you can skip this step.
To generate a config file you can run this command:
bunyip config path/to/config.js
This will take you through a multistep process to setup your username, password, tunnel url and tunnel command.
So I if wanted to save a config file to my home directory I would do the following.
bunyip config ~/config.js
If I want to specify a specific config file to use the -c, --cdir
flag lets you do that.
bunyip -f test/tests.html -c path/to/config.js
If you do not specify a config file to use it will look in your current working directory for a file name config.js
otherwise it will not require one in.
Behind the scenes bunyip uses a tool called Yeti unfortunately Yeti only works with YUI Test. However I have written some adaptors for QUnit and jasmine, go check out my other repo for examples on using them with your current test suites.
If you use another client-side testsuite please feel free to contribute it to my yeti-adaptors repo.
bunyip -f index.html
The above command will launch a simple Yeti hub on port 9000 and use the index.html
inside your current working directory.
bunyip -f index.html -p 1337
This will change the port that is used. The global config value will be updated for you so don't worry.
Using the local
command you can now open your test suite in all locally installed browsers or specify a series of browsers
bunyip -f index.html local
This will open in all locally installed browsers with one assumption that phantomjs is installed in /usr/bin/
.
bunyip -f index.html local -l "firefox|chrome|safari|phantomjs"
This will open the installed versions of Firefox, Chrome, Safari and Phantomjs.
The local
command looks for the following browsers:
bunyip -f index.html -b ios
Assuming you have a BrowserStack paid account and have setup a localhost sharing service the -b ios
will send off a command to launch all iOS devices (3 iPhones and 3 iPads) on BrowserStack and once they're connected you can run your test suite.
bunyip -s
This will query the BrowserStack API for any device or browsers that are currently running on your account.
bunyip -k <id> or all
If you no longer need a specific worker or you wish to destroy all of them you can either specify a single worker id or all
and it will destroy said worker(s).
bunyip -h
For more info specify the help flag to get more info about each command flag available.
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.
local
command to run your test suite in locally installed browsers.Copyright (c) 2012 Ryan Seddon
Licensed under the MIT license.
FAQs
Automate client-side unit testing in real browsers using the cli
The npm package bunyip receives a total of 2 weekly downloads. As such, bunyip popularity was classified as not popular.
We found that bunyip demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
Security News
A critical flaw in the popular npm form-data package could allow HTTP parameter pollution, affecting millions of projects until patched versions are adopted.
Security News
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.