diff --git a/.jshintrc b/.jshintrc index 0a289391..1f120860 100644 --- a/.jshintrc +++ b/.jshintrc @@ -44,7 +44,7 @@ // EcmaScript 5. - "es5" : true, // Allow EcmaScript 5 syntax. + "es5" : false, // Allow EcmaScript 5 syntax. "strict" : false, // Require `use strict` pragma in every file. "globalstrict" : false, // Allow global "use strict" (also enables 'strict'). diff --git a/index.js b/index.js index 38712e9e..94267fe9 100644 --- a/index.js +++ b/index.js @@ -5,7 +5,7 @@ you can include the Faker library into your existing node.js application by requiring the entire /Faker directory var faker = require(./faker); - var randomName = faker.name.findName(); + var randomName = Faker.Name.findName(); you can also simply include the "Faker.js" file which is the auto-generated bundled version of the Faker library @@ -17,20 +17,21 @@ */ -exports.name = require('./lib/name'); -exports.address = require('./lib/address'); -exports.phoneNumber = require('./lib/phone_number'); -exports.internet = require('./lib/internet'); -exports.company = require('./lib/company'); -exports.lorem = require('./lib/lorem'); -exports.helpers = require('./lib/helpers'); +exports.Name = require('./lib/name'); +exports.Address = require('./lib/address'); +exports.PhoneNumber = require('./lib/phone_number'); +exports.Internet = require('./lib/internet'); +exports.Company = require('./lib/company'); +exports.Lorem = require('./lib/lorem'); +exports.Helpers = require('./lib/helpers'); +exports.random = require('./lib/random'); exports.definitions = require('./lib/definitions'); -// Backward compatibility -exports.Name = exports.name; -exports.Address = exports.address; -exports.PhoneNumber = exports.phoneNumber; -exports.Internet = exports.internet; -exports.Company = exports.company; -exports.Lorem = exports.lorem; -exports.Helpers = exports.helpers; +// Aliases +exports.name = exports.Name; +exports.address = exports.Address; +exports.phoneNumber = exports.PhoneNumber; +exports.internet = exports.Internet; +exports.company = exports.Company; +exports.lorem = exports.Lorem; +exports.helpers = exports.Helpers; diff --git a/test/all.functional.js b/test/all.functional.js index 664a83dd..3984d140 100644 --- a/test/all.functional.js +++ b/test/all.functional.js @@ -6,29 +6,29 @@ var Faker = require('../index'); // Basic smoke tests to make sure each method is at least implemented and returns a string. var modules = { - address: [ + Address: [ 'city', 'streetName', 'streetAddress', 'secondaryAddress', - 'brState', 'ukCountry', 'ukCounty', 'usState', 'zipCode'//, 'zipCodeFormat' + 'brState', 'ukCountry', 'ukCounty', 'usState', 'zipCode' ], - company: ['companyName', 'companySuffix', 'catchPhrase', 'bs'], + Company: ['companyName', 'companySuffix', 'catchPhrase', 'bs'], - internet: ['email', 'userName', 'domainName', 'domainWord', 'ip'], + Internet: ['email', 'userName', 'domainName', 'domainWord', 'ip'], - lorem: ['words', 'sentence', 'sentences', 'paragraph', 'paragraphs'], + Lorem: ['words', 'sentence', 'sentences', 'paragraph', 'paragraphs'], - name: ['firstName', 'lastName', 'findName'], + Name: ['firstName', 'lastName', 'findName'], - phoneNumber: ['phoneNumber'] + PhoneNumber: ['phoneNumber'] }; // Backward compatibility. -modules.Address = modules.address; -modules.Company = modules.company; -modules.Internet = modules.internet; -modules.Lorem = modules.lorem; -modules.Name = modules.name; -modules.PhoneNumber = modules.phoneNumber; +modules.address = modules.Address; +modules.company = modules.Company; +modules.internet = modules.Internet; +modules.lorem = modules.Lorem; +modules.name = modules.Name; +modules.phoneNumber = modules.PhoneNumber; describe("functional tests", function () { Object.keys(modules).forEach(function (module) {