Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 29352c2

Browse files
author
Matt Carroll
committed
Merge branch 'master' into devel
2 parents 8db426d + 6bd45de commit 29352c2

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

packages/optimizely-sdk/lib/optimizely/index.tests.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2410,6 +2410,7 @@ describe('lib/optimizely', function() {
24102410
jsonSchemaValidator: jsonSchemaValidator,
24112411
logger: createdLogger,
24122412
isValidInstance: true,
2413+
eventDispatcher: eventDispatcher,
24132414
});
24142415

24152416
optlyInstance.notificationCenter.addNotificationListener(
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/**
2+
* Copyright 2019, Optimizely
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
/*
18+
* This is to stop & fail tests when an unhandled promise rejection occurs.
19+
* See: https://nodejs.org/api/process.html#process_event_unhandledrejection
20+
*/
21+
process.on('unhandledRejection', function(err) {
22+
console.error('Unhandled promise rejection');
23+
if (err) {
24+
console.error(err);
25+
}
26+
process.exit(1);
27+
});

packages/optimizely-sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"browser": "lib/index.browser.js",
77
"typings": "lib/index.d.ts",
88
"scripts": {
9-
"test": "mocha ./lib/*.tests.js ./lib/**/*.tests.js ./lib/**/**/*tests.js --recursive --exit",
9+
"test": "mocha ./lib/*.tests.js ./lib/**/*.tests.js ./lib/**/**/*tests.js --recursive --exit --require lib/tests/exit_on_unhandled_rejection.js",
1010
"test-xbrowser": "karma start karma.bs.conf.js --single-run",
1111
"test-umdbrowser": "npm run build-browser-umd && karma start karma.umd.conf.js --single-run",
1212
"build-browser-umd": "rm -rf dist && webpack",

0 commit comments

Comments
 (0)