alfred-notifier
alfred-notifier copied to clipboard
Add tests
Adds tests for if an update is available and if the workflow is already up to date. Closes #1.
For each test, a temporary directory is created with a package.json
and an info.plist
. A fake registry server is set up (and configured via .npmrc
) which always returns v2.0.0 as the latest version. The first test calls check.js
with v1.0.0 and expects the subtext
in info.plist
to be updated. The second test runs with v2.0.0 and expects the subtext
to remain the same.
Why use a random package name?
alfred-notifier caches the registry’s response using cache-conf. Using random package names allows the tests to run in parallel without interfering with the cache.