Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nisaacson/create-test-users
Create test couch profiles for use in testing authenticated web services which use the couch-profile module
https://github.com/nisaacson/create-test-users
Last synced: about 1 month ago
JSON representation
Create test couch profiles for use in testing authenticated web services which use the couch-profile module
- Host: GitHub
- URL: https://github.com/nisaacson/create-test-users
- Owner: nisaacson
- Created: 2013-03-12T22:02:10.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-03-14T19:54:11.000Z (over 11 years ago)
- Last Synced: 2024-10-06T13:17:16.598Z (about 1 month ago)
- Language: JavaScript
- Size: 103 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Create Test Users
Create test couch profiles for use in testing authenticated web services which use the [couch-profile](https://github.com/nisaacson/couch-profile) module# Installation
```bash
npm install create-test-users
```# Usage
```javascript
var inspect = require('eyespect').inspector()
var path = require('path')
var createTestUsers = require('create-test-users')
var jsonFilePath = path.join(__dirname, 'test/users.json')
var usersData = JSON.parse(fs.readFileSync(jsonFilePath, 'utf8'))
var config = require('nconf').env().argv().defaults({
bcrypt: {
rounds: 12
}
})// make sure the created profiles password match the input data
var confirmPasswordsMatch = true
var data = {
db: ,
remove: true, // remove existing first users or not,
config: config,
usersData: usersData,
confirmPasswordsMatch: confirmPasswordsMatch
}
createTestUsers(data, function(err, reply) {
if (err) {
inspect(err, 'error creating test users')
return
}
inspect(reply, 'created test users successfully')
})
```