@webex/test-helper-test-users
Advanced tools
Comparing version 1.80.24 to 1.80.25
@@ -46,2 +46,5 @@ 'use strict'; | ||
* @param {Object} options | ||
* @param {number} options.count amount of users to create | ||
* @param {Object} options.config configuration to pass to test-users library | ||
* see test-users package for full options | ||
* @private | ||
@@ -48,0 +51,0 @@ * @returns {Promise<Array<User>>} |
{ | ||
"name": "@webex/test-helper-test-users", | ||
"version": "1.80.24", | ||
"version": "1.80.25", | ||
"description": "", | ||
@@ -23,6 +23,6 @@ "license": "MIT", | ||
"lodash": "^4.17.15", | ||
"@webex/test-helper-retry": "1.80.24", | ||
"@webex/test-users": "1.80.24", | ||
"@webex/test-helper-retry": "1.80.25", | ||
"@webex/test-users": "1.80.25", | ||
"envify": "^4.1.0" | ||
} | ||
} |
@@ -21,2 +21,57 @@ # @webex/test-helper-test-users | ||
The `test-helper-test-users` package is a helper for [mocha](https://mochajs.org/) tests that handles the creation and deletion of test users in integration tests. | ||
```javascript | ||
import webex from 'webex'; | ||
import testUsers from '@webex/test-helper-test-users'; | ||
describe('My Amazing Integration Test Suite', () => { | ||
let testUserA, testUserB, testUserC; | ||
before('create users', () => { | ||
// Create Three Test Users | ||
return testUsers.create({count: 3}) | ||
}) | ||
.then((createdTestUsers) => { | ||
// Save the created test users | ||
[testUserA, testUserB, testUserC] = createdTestUsers; | ||
// Create a new sdk instance for the test user | ||
testUserA.webex = webex.init({ | ||
config: { | ||
credentials: { | ||
authorization: testUserA.token | ||
} | ||
} | ||
}); | ||
it('can do things with a test user', () => { | ||
testUserA.people.get('me') | ||
}); | ||
``` | ||
### Environment Defaults | ||
The test users package defaults to certain environment variables if the values aren't specified in the "create" command. Those variables are: | ||
- `WEBEX_CLIENT_ID` - The Webex client ID that has access to create test users | ||
- `WEBEX_CLIENT_SECRET` - The Webex client secret for the given client id | ||
- `WEBEX_TEST_USERS_CONVERSATION_SERVICE_URL` - The Webex url for conversation service to create test users | ||
- `WEBEX_SCOPE` - The Webex scope the test users should be created with | ||
- `IDBROKER_BASE_URL` - The Webex auth endpoint to get a client based access token | ||
These variables can been passed in to the `create` command as a `config` object as well: | ||
```javascript | ||
const createConfig = { | ||
clientId: mySpecificValue, | ||
clientSecret: mySpecificValue, | ||
idbrokerUrl: mySpecificValue, | ||
conversationServiceUrl: mySpecificValue, | ||
scope: mySpecificValue | ||
}; | ||
testUsers.create({config: createConfig}); | ||
``` | ||
## Maintainers | ||
@@ -23,0 +78,0 @@ |
@@ -29,2 +29,5 @@ /*! | ||
* @param {Object} options | ||
* @param {number} options.count amount of users to create | ||
* @param {Object} options.config configuration to pass to test-users library | ||
* see test-users package for full options | ||
* @private | ||
@@ -31,0 +34,0 @@ * @returns {Promise<Array<User>>} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13786
184
87
+ Added@webex/common@1.80.25(transitive)
+ Added@webex/http-core@1.80.25(transitive)
+ Added@webex/test-helper-retry@1.80.25(transitive)
+ Added@webex/test-users@1.80.25(transitive)
- Removed@webex/common@1.80.24(transitive)
- Removed@webex/http-core@1.80.24(transitive)
- Removed@webex/test-helper-retry@1.80.24(transitive)
- Removed@webex/test-users@1.80.24(transitive)
Updated@webex/test-users@1.80.25