Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Start running your client `Jasmine` tests headlessly with `PhantomJS` and `gulp` today.
Start running your client Jasmine
tests headlessly with PhantomJS
and gulp
today.
You should use Erik when you have a suite of client Jasmine tests that you currently run by opening a SpecRunner.html
file but would prefer to run headlessly via a gulp
task.
Erik utilizes Karma to run your Jasmine tests with PhantomJS.
It abstracts away Karma's details and configuration so that you can begin running your tests with PhantomJS quickly and easily.
Simply adapt the below example configuration for your use.
$ yarn add -D erik
or
$ npm install --save-dev erik
my CI platform
?Yes! Erik's exit code is determined by the outcome of your test suite, so integration with your CI platform should be easy.
We use gulp-remote-src
to fetch the remote dependencies that currently live in your SpecRunner.html
script
tags.
If you're like us, you already have gulp
tasks for bundling (and perhaps transpiling) your test suite along with its dependencies. It's easier to keep that configuration and simply pass the path of your bundled, transpiled test suite than it is to duplicate that configuration with Karma preprocessing. Additionally, we've disabled Karma's default preprocessing of coffeescript
files.
mocha
reporterKarma's default progress
reporter isn't quite as nice as the report shown by Jasmine. Erik uses karma-mocha-reporter
so that you can see a similar, friendly, hierarchical overview of your specs as they complete.
Please make sure that all of your dependencies are compatible with PhantomJS.
(in your gulpfile
)
const SHOULD_WATCH = !!argv.watch;
// Creating an `Erik` object registers several tasks with gulp (all prefixed with 'erik-').
new Erik({
// The gulp instance with which to register Erik's tasks.
gulp,
/**
* When watch is set, Erik will watch for changes to your bundled spec and re-run the test suite
* when changes occur.
*/
watch: SHOULD_WATCH,
/**
* Names of tasks to be run before any Erik processing is done. Useful for registering your
* spec-building/processing tasks as dependencies of Erik's testing task. These tasks will be run
* in serial as passed.
*/
taskDependencies: [
'build-spec-bundle',
'bower'
],
/**
* Local dependencies to be bundled alongside your remote dependencies. Glob strings. Useful for
* including your bower-installed packages, for example.
*/
localDependencies: [
'public/build-lib.js',
'public/lib/ext/**/*'
],
/**
* URLs corresponding to remote dependencies.
*/
remoteDependencies: [
'https://cdn.jsdelivr.net/g/es6.shim@0.35.3',
'https://cdn.jsdelivr.net/g/jquery@2.1.4',
'https://cdn.jsdelivr.net/g/underscorejs@1.8.3',
],
/**
* Path to your bundled test suite. This should be an IIFE.
*/
bundledSpecPath: 'spec/client/tests.js',
/**
* This configuration is not passed directly into Karma but rather is processed by Erik. Only
* `port` is supported at this time.
*/
karmaConfig: {
/**
* Port on which to run the Karma server. Defaults to 9876.
*/
port: 1337
},
// Base path to use for Erik's bundled files. A directory named `.erik` will be created here.
bundlePath: 'spec/client'
});
// Optionally configure Gulp to watch for spec changes.
gulp.on('task_start', function(e) {
if (e.task === 'erik') {
if (SHOULD_WATCH) {
console.log('Watching testsâ¦');
gulp.watch(TEST_FILES, ['build-spec-bundle']);
}
}
});
Run your test suite!
$ gulp erik [--watch]
We welcome pull requests! Please lint your code using the JSHint configuration in this project.
Erik is the name of the Phantom in Phantom of the Opera :D
FAQs
Start running your client `Jasmine` tests headlessly with Headless Chrome and `gulp` today.
The npm package erik receives a total of 15 weekly downloads. As such, erik popularity was classified as not popular.
We found that erik demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 25 open source maintainers 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.