easy-amdtest

2020-01-15

easy-amdtest

Class for quickly and easily testing AMD modules.

build statusdependency statusdevdependency status">easy-amdtest Build StatusDependency StatusdevDependency Status

The purpose of this library is to streamline the process of testing, locally and in the cloud, by abstracting away the majority of the required boiler code.

Supported Frameworks:

  • Mocha

Supported Platforms:

  • SauceLabs

Example

<script src="../bower_components/requirejs/require.js"></script>
<script src="../dist/easy-amdtest.js"></script>
<script>
  var testSuite = new EasyAMDTest({
    urlArgs: "bust=" + (new Date()).getTime(),
    paths: {
      'proclaim' : '/node_modules/proclaim/lib/proclaim',
      'mocha'    : '/node_modules/mocha/mocha'
    }
  }).run({
    name: 'mocha',
    tests: ['./easy-amdtest-mocha.js']
  });
</script>

Install

$ npm install easy-amdtest
bower install easy-amdtest

API

EasyAMDTest(configuration)

Class for quickly and easily testing AMD modules.

PARAMETERS:
  • *configuration: Object -- Requirejs configuration object.
RETURNS:

EasyAMDTest instance.

EXAMPLE USAGE:
var tests = new EasyAMDTest({
  baseUrl: '../src',
  paths: {
    'underscore': '/bower_components/underscore/underscore'
  }
});

EasyAMDTest.run(options)

Run your test suite.

PARAMETERS:
  • *options: Object
    • *name: String - Name of the test framework to use.
    • *opts: Object - Options for the given framework.
    • **dependencies: Array - List of dependencies required for tests.
EXAMPLE USAGE:
new EasyAMDTest(requireConfig).run({
  name: 'mocha',
  opts: {
    style: 'bdd'
  }
});

Frameworks

Mocha

Name

mocha

Options

style: String -- bddor tdd


TESTS

Local

Install Dependencies

npm install

Execute Tests

grunt test-local

License

The MIT License (MIT) Copyright (c) 2014 First Opinion

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

以上是 easy-amdtest 的使用教程帮助文档。


上一篇:react-grid-layout 栅格布局
下一篇:bbb
相关教程
关注微信

扫码加入 JavaScript 社区

相关文章

首次访问,需要验证
微信扫码,关注即可
(仅需验证一次)

欢迎加入 JavaScript 社区

号内回复关键字:

回到顶部