8000 Merge branch 'master' into zeeshan/remove-promise-polyfill · optimizely/javascript-sdk@e1bb4f9 · GitHub
[go: up one dir, main page]

Skip to content

Commit e1bb4f9

Browse files
authored
Merge branch 'master' into zeeshan/remove-promise-polyfill
2 parents a20a14c + 026a21c commit e1bb4f9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+3801
-2810
lines changed

packages/optimizely-sdk/CHANGELOG.MD

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77

88
## [Unreleased]
99

10+
## [3.6.0-alpha.1] - March 4, 2020
11+
12+
### New Features
13+
1014
- Changed `track()` to log a warning instead of an error when the event isn't in the datafile ([#418](https://github.com/optimizely/javascript-sdk/pull/418))
1115

1216
## [3.5.0] - February 20th, 2020

packages/optimizely-sdk/karma.base.conf.js

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module.exports = {
2929
//browserStack setup
3030
browserStack: {
3131
username: process.env.BROWSER_STACK_USERNAME,
32-
accessKey: process.env.BROWSER_STACK_ACCESS_KEY
32+
accessKey: process.env.BROWSER_STACK_ACCESS_KEY,
3333
},
3434

3535
// to avoid DISCONNECTED messages when connecting to BrowserStack
@@ -45,46 +45,46 @@ module.exports = {
4545
browser: 'chrome',
4646
browser_version: '21.0',
4747
os: 'OS X',
48-
os_version: 'Mountain Lion'
48+
os_version: 'Mountain Lion',
4949
},
5050
bs_edge: {
5151
base: 'BrowserStack',
5252
os: 'Windows',
5353
os_version: '10',
5454
browser: 'edge',
5555
device: null,
56-
browser_version: '15.0'
56+
browser_version: '15.0',
5757
},
5858
bs_firefox_mac: {
5959
base: 'BrowserStack',
6060
browser: 'firefox',
6161
browser_version: '21.0',
6262
os: 'OS X',
63-
os_version: 'Mountain Lion'
63+
os_version: 'Mountain Lion',
6464
},
6565
bs_ie: {
6666
base: 'BrowserStack',
6767
os: 'Windows',
6868
os_version: '7',
6969
browser: 'ie',
7070
device: null,
71-
browser_version: '10.0'
71+
browser_version: '10.0',
7272
},
7373
bs_opera_mac: {
7474
base: 'BrowserStack',
7575
browser: 'opera',
7676
browser_version: '37',
7777
os: 'OS X',
78-
os_version: 'Mountain Lion'
78+
os_version: 'Mountain Lion',
7979
},
8080
bs_safari: {
8181
base: 'BrowserStack',
8282
os: 'OS X',
8383
os_version: 'Mountain Lion',
8484
browser: 'safari',
8585
device: null,
86-
browser_version: '6.2'
87-
}
86+
browser_version: '6.2',
87+
},
8888
},
8989

9090
browsers: ['bs_chrome_mac', 'bs_edge', 'bs_firefox_mac', 'bs_ie', 'bs_opera_mac', 'bs_safari'],
@@ -94,31 +94,25 @@ module.exports = {
9494
frameworks: ['mocha'],
9595

9696
// list of files to exclude
97-
exclude: [
98-
],
99-
97+
exclude: [],
10098

10199
// preprocess matching files before serving them to the browser
102100
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
103101
preprocessors: {
104-
'./lib/**/*tests.js': ['webpack']
102+
'./lib/**/*tests.js': ['webpack'],
105103
},
106104

107-
108105
// test results reporter to use
109106
// possible values: 'dots', 'progress'
110107
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
111108
reporters: ['progress'],
112109

113-
114110
// web server port
115111
port: 9876,
116112

117-
118113
// enable / disable colors in the output (reporters and logs)
119114
colors: true,
120115

121-
122116
// enable / disable watching file and executing tests whenever any file changes
123117
autoWatch: false,
124118

@@ -128,5 +122,5 @@ module.exports = {
128122

129123
// Concurrency level
130124
// how many browser should be started simultaneous
131-
concurrency: Infinity
132-
}
125+
concurrency: Infinity,
126+
};

packages/optimizely-sdk/karma.bs.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
// Karma configuration for cross-browser testing
18-
const baseConfig = require('./karma.base.conf.js')
18+
const baseConfig = require('./karma.base.conf.js');
1919

2020
module.exports = function(config) {
2121
config.set({

packages/optimizely-sdk/karma.umd.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
// Karma configuration for UMD bundle testing
18-
const baseConfig = require('./karma.base.conf.js')
18+
const baseConfig = require('./karma.base.conf.js');
1919

2020
module.exports = function(config) {
2121
config.set({

packages/optimizely-sdk/lib/core/audience_evaluator/index.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ var LOG_LEVEL = enums.LOG_LEVEL;
2626
var LOG_MESSAGES = enums.LOG_MESSAGES;
2727
var MODULE_NAME = 'AUDIENCE_EVALUATOR';
2828

29-
3029
/**
3130
* Construct an instance of AudienceEvaluator with given options
3231
* @param {Object=} UNSTABLE_conditionEvaluators A map of condition evaluators provided by the consumer. This enables matching
@@ -36,7 +35,7 @@ var MODULE_NAME = 'AUDIENCE_EVALUATOR';
3635
*/
3736
function AudienceEvaluator(UNSTABLE_conditionEvaluators) {
3837
this.typeToEvaluatorMap = fns.assign({}, UNSTABLE_conditionEvaluators, {
39-
'custom_attribute': customAttributeConditionEvaluator
38+
custom_attribute: customAttributeConditionEvaluator,
4039
});
4140
}
4241

@@ -66,8 +65,14 @@ AudienceEvaluator.prototype.evaluate = function(audienceConditions, audiencesByI
6665
var evaluateAudience = function(audienceId) {
6766
var audience = audiencesById[audienceId];
6867
if (audience) {
69-
logger.log(LOG_LEVEL.DEBUG, sprintf(LOG_MESSAGES.EVALUATING_AUDIENCE, MODULE_NAME, audienceId, JSON.stringify(audience.conditions)));
70-
var result = conditionTreeEvaluator.evaluate(audience.conditions, this.evaluateConditionWithUserAttributes.bind(this, userAttributes));
68+
logger.log(
69+
LOG_LEVEL.DEBUG,
70+
sprintf(LOG_MESSAGES.EVALUATING_AUDIENCE, MODULE_NAME, audienceId, JSON.stringify(audience.conditions))
71+
);
72+
var result = conditionTreeEvaluator.evaluate(
73+
audience.conditions,
74+
this.evaluateConditionWithUserAttributes.bind(this, userAttributes)
75+
);
7176
var resultText = result === null ? 'UNKNOWN' : result.toString().toUpperCase();
7277
logger.log(LOG_LEVEL.INFO, sprintf(LOG_MESSAGES.AUDIENCE_EVALUATION_RESULT, MODULE_NAME, audienceId, resultText));
7378
return result;
@@ -95,7 +100,10 @@ AudienceEvaluator.prototype.evaluateConditionWithUserAttributes = function(userA
95100
try {
96101
return evaluator.evaluate(condition, userAttributes, logger);
97102
} catch (err) {
98-
logger.log(LOG_LEVEL.ERROR, sprintf(ERROR_MESSAGES.CONDITION_EVALUATOR_ERROR, MODULE_NAME, condition.type, err.message));
103+
logger.log(
104+
LOG_LEVEL.ERROR,
105+
sprintf(ERROR_MESSAGES.CONDITION_EVALUATOR_ERROR, MODULE_NAME, condition.type, err.message)
106+
);
99107
}
100108
return null;
101109
};

0 commit comments

Comments
 (0)
0