All Downloads are FREE. Search and download functionalities are using the official Maven repository.

Javascript.es6.api_test.mustache Maven / Gradle / Ivy

There is a newer version: 3.0.0-rc1
Show newest version
{{>licenseInfo}}
(function(root, factory) {
  if (typeof define === 'function' && define.amd) {
    // AMD.
    define(['expect.js', '../../src/index'], factory);
  } else if (typeof module === 'object' && module.exports) {
    // CommonJS-like environments that support module.exports, like Node.
    factory(require('expect.js'), require('../../src/index'));
  } else {
    // Browser globals (root is window)
    factory(root.expect, root.{{moduleName}});
  }
}(this, function(expect, {{moduleName}}) {
  'use strict';

  var instance;

  beforeEach(function() {
    instance = new {{moduleName}}.{{classname}}();
  });

  var getProperty = function(object, getter, property) {
    // Use getter method if present; otherwise, get the property directly.
    if (typeof object[getter] === 'function')
      return object[getter]();
    else
      return object[property];
  }

  var setProperty = function(object, setter, property, value) {
    // Use setter method if present; otherwise, set the property directly.
    if (typeof object[setter] === 'function')
      object[setter](value);
    else
      object[property] = value;
  }

  describe('{{classname}}', function() {
{{#operations}}
{{#operation}}
    describe('{{operationId}}', function() {
      it('should call {{operationId}} successfully', function(done) {
        //uncomment below and update the code to test {{operationId}}
        //instance.{{operationId}}(function(error) {
        //  if (error) throw error;
        //expect().to.be();
        //});
        done();
      });
    });
{{/operation}}
{{/operations}}
  });

}));




© 2015 - 2024 Weber Informatics LLC | Privacy Policy