dpro
data provider for testarmada
Last updated 2 years ago by thunderzhulei .
MIT · Original npm · Tarball · package.json
$ cnpm install dpro 
SYNC missed versions from official npm registry.

Data provider for testarmada

Build Status License: MIT codecov

file format

Provider should only support .js. .js support is to allow user generate some random data on the fly, like user registration scenario that requires fresh email account every time.

Each .js data file should return a json object.

supported files

   ${DPRO}.js          : main test data
   ${DPRO_INST}.js : (optional) extra data that only applies to certain instance

default file location

  ${REPO_ROOT}/config/data

  # file location can be changed by using
  ${DPRO_LOCATION}

file loading rules

basic

 # to only load from ${REPO_ROOT}/config/data/local.js
 DPRO=local ./node_modules/.bin/magellan --test xxxxx ......

 # to only load from ${REPO_ROOT}/config/data/prod-a.js
 DPRO=prod-a ./node_modules/.bin/magellan --test xxxxx ......

advantage

 # change file location to ${REPO_ROOT}/config/staging.js
 DPRO_LOCATION="./config/" DPRO=staging ./node_modules/.bin/magellan --test xxxxx ......

 # load both ${REPO_ROOT}/config/data/staging.js and ${REPO_ROOT}/config/data/staging-2.js
 # config in staging-2.js will be used if common config exists.
 DPRO=staging DPRO_INST=2 ./node_modules/.bin/magellan --test xxxxx ......

usage

 /** data file
 *{
 * "beijing": {
 *     "name": "Beijing",
 *     "country": "China",
 *     "description": "It is the most populous city in the China"
 *   },
 *   "timestamp": function () {
 *     return new Date().getTime();
 *  }
 *}
 */
 var td = require("dpro");

 console.log(td.beijing, td.beijing.description);
 console.log(td.timestamp());

License

Documentation in this project is licensed under Creative Commons Attribution 4.0 International License. Full details available at https://creativecommons.org/licenses/by/4.0

Current Tags

  • 1.2.1                                ...           latest (2 years ago)

15 Versions

  • 1.2.1                                ...           2 years ago
  • 1.2.0                                ...           4 years ago
  • 1.1.0                                ...           4 years ago
  • 1.1.0-beta11                                ...           4 years ago
  • 1.1.0-beta9                                ...           4 years ago
  • 1.1.0-beta8                                ...           4 years ago
  • 1.1.0-beta6                                ...           4 years ago
  • 1.1.0-beta5                                ...           4 years ago
  • 1.1.0-beta4                                ...           4 years ago
  • 1.1.0-beta3                                ...           4 years ago
  • 1.1.0-beta2                                ...           4 years ago
  • 1.1.0-beta1                                ...           4 years ago
  • 1.0.2                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 2
Dependencies (4)
Dev Dependencies (10)
Dependents (2)

Copyright 2014 - 2016 © taobao.org |