New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

benderjs-yui

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

benderjs-yui

Adapter for YUI3 testing framework for Bender.js

latest
Source
npmnpm
Version
0.3.4
Version published
Weekly downloads
148
0.68%
Maintainers
1
Weekly downloads
 
Created
Source

benderjs-yui

Adapter for YUI3 testing framework for Bender.js.

Installation

npm install benderjs-yui

Usage

Add benderjs-yui to the plugins array in the bender.js configuration file:

var config = {
    applications: {...}

    browsers: [...],

    plugins: ['benderjs-yui'], // load the plugin

    tests: {...}
};

module.exports = config;

Set yui as a framework for entire project or a specific tests group:

var config = {
    applications: {...}

    browsers: [...],

    framework: 'yui', // use for entire project

    plugins: ['benderjs-yui'],

    tests: {
        Foo: {
            basePath: '',
            framework: 'yui' // use for a specific tests group
            paths: [...]
        }
    }
};

module.exports = config;

API

To run a test case use bender.test API:

bender.test({

    'test foo': function () {
        bender.assert.areEqual(5, 5);
        bender.assert.areNotEqual(5, 6);
    },

    'test bar': function () {...}

});

Some of YUI namespaces were exposed in bender namespace, at the moment you can use:

  • bender.Y -> Y
  • bender.assert -> Y.Assert
  • bender.objectAssert -> Y.ObjectAssert
  • bender.arrayAssert -> Y.ArrayAssert

Features

  • single test execution
  • nested test suites

Using nested test suites

You may create multiple nested suites. To do so, in test suite passed to bender.test create an object containing property suite set to true.

bender.test({

    'test foo': function () {
        bender.assert.areEqual(5, 5);
        bender.assert.areNotEqual(5, 6);
    },

    'test suite': {
    	suite: true,

    	'test bar': function() {
    		bender.assert.areNotEqual('bar','baz');
    	},

    	'test bar2': function() {
			bender.assert.areNotEqual('bar2','baz');
		},

    	'test nested suite': {
    		suite: true,

    		'test baz': function() {
    			bender.assert.areEqual('baz','baz');
    		}
    	}
    }

});

If you provide setUp or tearDown functions, they will be fired for all tests in the suite, but not for the tests in nested suites.

License

MIT, for license details see: LICENSE.md.

Keywords

bender

FAQs

Package last updated on 21 Jan 2019

Did you know?

Socket

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.

Install

Related posts