shape-tests

0.0.0 • Public • Published

Shape Test Generator

Generates 'it' statements based on an object that holds properties and methods that relate to the exposed properties and functions on an object/module

Example usage:

var components = require('.<your module to test>');
 
var generateFunctionSignatureExpects = require('shape-tests').generateFunctionSignatureExpects;
var generatePropertyExpects = require('shape-tests').generatePropertyExpects;
 
describe('My Module: ', function() {
    'use strict';
 
    var coreShape = {
        properties: [{
            name: 'somePropString',
            type: 'string'
        }, {
            name: 'someBoolean',
            type: 'boolean'
        }, {
            name: 'someObject',
            type: 'object'
        }],
        methods: [{
            name: 'someMethod',
            numArgs: 3
        }, {
            name: 'someOtherMethod',
            numArgs: 2
        }]
    };
 
    describe('Components:', function() {
        generateFunctionSignatureExpects(components, coreShape.methods);
        generatePropertyExpects(components, coreShape.properties);
    });
 
}); 

Readme

Keywords

Package Sidebar

Install

npm i shape-tests

Weekly Downloads

0

Version

0.0.0

License

MIT

Last publish

Collaborators

  • datamadic