Skip to content

Commit

Permalink
Moved testing configuration to into validator defaults.
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaronius committed May 10, 2019
1 parent 90029e3 commit e596d05
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/components/DataCollector/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ governing permissions and limitations under the License.

import createRequest from "../../core/createRequest";
import createEvent from "../../core/createEvent";
import { required } from "../../core/createConfig";

const createDataCollector = ({ config }) => {
let lifecycle;
Expand Down Expand Up @@ -52,7 +51,8 @@ createDataCollector.namespace = "DataCollector";

createDataCollector.configValidators = {
collectionUrl: {
validate: required
defaultValue: "https://edgegateway.azurewebsites.net"
// defaultValue: "http://ex-edge.stable-stage.aam-npe.adobeinternal.net/v1"
},
device: {
defaultValue: "UNKNOWN-DEVICE"
Expand Down
18 changes: 3 additions & 15 deletions src/core/createInstance.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,10 @@ import { isFunction, toError } from "../utils";
import createConfig, { required } from "./createConfig";

const configValidators = {
orgID: { validate: required },
propertyID: { validate: required },
dataSet: { validate: required }
};

// TODO: For testing purposes only. Remove eventually.
const augmentTestingOptions = options => {
// eslint-disable-next-line no-param-reassign
options.shouldStoreCollectedData = 1;
// eslint-disable-next-line no-param-reassign
options.device = "Chrome-Mac";
// eslint-disable-next-line no-param-reassign
options.collectionUrl = "https://edgegateway.azurewebsites.net";
// options.collectionUrl = "http://ex-edge.stable-stage.aam-npe.adobeinternal.net/v1";
// TODO: For debugging purposes only. Remove eventually.
shouldStoreCollectedData: { defaultValue: 1 },
device: { defaultValue: "Chrome-Mac" }
};

export default (namespace, initializeComponents, debugController) => {
Expand All @@ -39,8 +29,6 @@ export default (namespace, initializeComponents, debugController) => {
};

const configureCommand = options => {
augmentTestingOptions(options);

if (options.debug !== undefined) {
debugCommand({ enabled: options.debug });
}
Expand Down

0 comments on commit e596d05

Please sign in to comment.