aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorashmothership <[email protected]>2016-03-20 01:43:26 +0000
committerashmothership <[email protected]>2016-03-20 01:43:26 +0000
commitb41d9a393703d84ff7e0588036ba73cc49f06232 (patch)
tree3babf5b85064296e60ee0d0332c166e2951e51aa
parent1238c8b65e15972f9746863b8b3b5a6161b34770 (diff)
parenteef113c2cec2a83116e31d36473ef2b393058a1f (diff)
downloadfaker-b41d9a393703d84ff7e0588036ba73cc49f06232.tar.xz
faker-b41d9a393703d84ff7e0588036ba73cc49f06232.zip
Merge remote-tracking branch 'Marak/master'
-rwxr-xr-x.travis.yml13
-rw-r--r--lib/fake.js7
-rw-r--r--lib/finance.js1
-rw-r--r--lib/random.js9
-rw-r--r--package.json13
-rw-r--r--test/finance.unit.js10
6 files changed, 40 insertions, 13 deletions
diff --git a/.travis.yml b/.travis.yml
index 5c6ca522..f31189df 100755
--- a/.travis.yml
+++ b/.travis.yml
@@ -2,11 +2,18 @@
sudo: false
language: node_js
node_js:
+ - "5"
+ - "5.1"
+ - "4"
+ - "4.2"
+ - "4.1"
+ - "4.0"
+ - "0.12"
- "0.11"
- "0.10"
- # meteor specific node version
- - "0.10.36"
-# - "0.8"
+ - "0.8"
+ - "0.6"
+ - "iojs"
before_install:
# Install meteor and spacejam, a meteor command line package tester
diff --git a/lib/fake.js b/lib/fake.js
index 977ba292..7e24c854 100644
--- a/lib/fake.js
+++ b/lib/fake.js
@@ -86,7 +86,12 @@ function Fake (faker) {
params = parameters;
}
- var result = fn.call(this, params);
+ var result;
+ if (typeof params === "string" && params.length === 0) {
+ result = fn.call(this);
+ } else {
+ result = fn.call(this, params);
+ }
// replace the found tag with the returned fake value
res = str.replace('{{' + token + '}}', result);
diff --git a/lib/finance.js b/lib/finance.js
index 9b478573..a7c7b873 100644
--- a/lib/finance.js
+++ b/lib/finance.js
@@ -134,6 +134,7 @@ var Finance = function (faker) {
}
return symbol;
}
+
}
module['exports'] = Finance;
diff --git a/lib/random.js b/lib/random.js
index b152ddbd..d3cbf3ea 100644
--- a/lib/random.js
+++ b/lib/random.js
@@ -189,6 +189,15 @@ function Random (faker, seed) {
return faker.random.arrayElement(Object.keys(faker.locales));
};
+ /**
+ * alphaNumeric
+ *
+ * @method faker.random.alphaNumeric
+ */
+ this.alphaNumeric = function alphaNumeric() {
+ return faker.random.arrayElement(["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]);
+ }
+
return this;
}
diff --git a/package.json b/package.json
index 88628698..0dae329a 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "faker",
"description": "Generate massive amounts of fake contextual data",
- "version": "3.0.1",
+ "version": "3.1.0",
"contributors": [
"Marak Squires <[email protected]>",
"Matthew Bergman <[email protected]>"
@@ -18,21 +18,16 @@
},
"devDependencies": {
"browserify": "5.11.1",
- "gulp": "3.8.8",
- "gulp-mustache": "0.4.0",
- "gulp-rename": "1.2.0",
- "gulp-uglify": "1.0.1",
- "jsdoc": "^3.4.0",
"jshint": "0.9.0",
"lodash": "^2.4.1",
"mocha": "1.8.x",
"node-minify": "*",
"optimist": "0.3.5",
"sinon": "1.4.2",
- "vinyl-transform": "0.0.1",
"through2": "2.0.0",
- "ink-docstrap": "1.1.4"
+ "vinyl-transform": "0.0.1"
},
"license": "MIT",
- "main": "index.js"
+ "main": "index.js",
+ "dependencies": {}
}
diff --git a/test/finance.unit.js b/test/finance.unit.js
index ceb15244..2c5442d8 100644
--- a/test/finance.unit.js
+++ b/test/finance.unit.js
@@ -202,4 +202,14 @@ describe('finance.js', function () {
assert.ok(currencyCode.match(/[A-Z]{3}/));
});
})
+
+ /*
+ describe("bitcoinAddress()", function(){
+ it("returns a random bitcoin address", function(){
+ var bitcoinAddress = faker.finance.bitcoinAddress();
+
+ assert.ok(bitcoinAddress.match(/^[A-Z0-9.]{27,34}$/));
+ });
+ });
+ */
}); \ No newline at end of file