
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
intern-yadda-loader
Advanced tools
Yadda is a plain-language BDD system for Javascript. Intern is a flexible Javascript test runner. This package loads Yadda features/scenarios/steps as Intern suites/tests.
this.ctx
.this.async()
api).See the Intern User Guide for information on setting up an intern project. Then install yadda
and intern-yadda-loader
:
$ npm install yadda intern-yadda-loader --save-dev
NOTE: Yadda is a peer dependency of intern-yadda-loader
.
// `test/conf.js`
define({
environments: [{browserName: 'phantomjs'}],
loaderOptions: {
packages: [
// Load `intern-yadda-loader` as `yadda`
{ name: 'yadda', location: './node_modules/intern-yadda-loader' },
// Load package containing step definitions
{ name: 'steps', location: './test/steps' }
]
},
functionalSuites: [
// Specify features to load
'yadda!test/features/bottles.feature',
'yadda!test/features/google.feature'
// Also accepts directories, e.g. `yadda!test/features`
],
// Yadda configuration
yadda: {
// An array or string specifying step definition packages to load
steps: [
'steps/bottles-library',
'steps/google-library'
],
// The language to use when parsing the features (default: `English`)
lang: 'English'
}
});
# `test/features/bottles.feature`
Feature: 100 Green Bottles
Scenario: Should fall from the wall
Given 100 green bottles are standing on the wall
When 1 green bottle accidentally falls
And another falls
Then there are 98 green bottles standing on the wall
// `test/steps/bottles-library.js`
define(function (require) {
var expect = require('intern/chai!expect');
return function (library) {
library
.given("$NUM green bottles are standing on the wall", function (number) {
// The context is reused only within the current scenario.
expect(this.ctx.bottles).to.be.undefined;
this.ctx.bottles = parseInt(number);
})
.when("$NUM green bottle accidentally falls", function (number, next) {
// Async using `next` callback.
var ctx = this.ctx;
setTimeout(function () {
ctx.bottles--;
next();
}, 200);
})
.define("And another falls", function () {
// Async using Intern `this.async()` convention.
var ctx = this.ctx;
var deferred = this.async();
setTimeout(function () {
ctx.bottles--;
deferred.resolve();
}, 200);
})
.then("there are $NUM green bottles standing on the wall", function (number) {
expect(this.ctx.bottles).to.equal(parseInt(number));
});
};
});
# `test/features/google.feature`
Feature: Multilingual Google Search
Scenario: Searching Google For The First Time
When I open Google's fr search page
then the title is Google
and the search form exists
When I search for foo
then the title is foo - Recherche Google
and the search for foo was made
and 10 or more results were returned
Scenario: Searching Google Again
When I open Google's ie search page
then the title is Google
and the search form exists
When I search for bar
then the title is bar - Google Search
and the search for bar was made
and 10 or more results were returned
// `test/steps/google-library.js`
define(function (require) {
var expect = require('intern/chai!expect');
return function (library, dictionary) {
// Access to dictionary for custom definitions.
dictionary
.define('LOCALE', /(fr|es|ie)/)
.define('NUM', /(\d+)/);
library
.when("I open Google's $LOCALE search page", function(locale) {
return this.remote.get("http://www.google." + locale + "/");
})
.then("the title is $TITLE", function(title) {
return this.remote
.sleep(500)
.getPageTitle()
.then(function (pageTitle) {
expect(pageTitle).to.equal(title);
});
})
.then("the $ACTION form exists", function(action) {
return this.remote
.findByCssSelector('form[action="/' + action + '"]');
})
.when("I search for $TERM", function(term) {
return this.remote
.findByName('q')
.click()
.type(term + '\n');
})
.then("the search for $TERM was made", function(term) {
var regex = new RegExp('q=' + term);
return this.remote
.sleep(500)
.getCurrentUrl()
.then(function (url) {
expect(url).to.match(new RegExp('q=' + term));
});
})
.then("$NUM or more results were returned", function(number) {
return this.remote
.findAllByCssSelector('h3.r')
.then(function (elements) {
expect(elements).to.have.length.of.at.least(parseInt(number));
});
});
};
});
FAQs
Yadda loader for Intern
The npm package intern-yadda-loader receives a total of 0 weekly downloads. As such, intern-yadda-loader popularity was classified as not popular.
We found that intern-yadda-loader 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.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.