Skip to content

Commit 5d9ba06

Browse files
Nols1000danrevah
authored andcommitted
Add null check to extractDeepPropertyByMapKey in helpers.ts (#159)
* Add puppeteer to run tests even if no chrome is installed Signed-off-by: Nils-Börge Margotti <nilsmargotti@gmail.com> * Add custom launcher with flag '--no-sandbox' to work around a problem with some linux distros Signed-off-by: Nils-Börge Margotti <nilsmargotti@gmail.com> * Add data to replicate #154 in filter-by.spec.tsSigned-off-by: Nils-Börge Margotti <nilsmargotti@gmail.com> Signed-off-by: Nils-Börge Margotti <nilsmargotti@gmail.com> * Add null check for nested properties to fix #158Signed-off-by: Nils-Börge Margotti <nilsmargotti@gmail.com> Signed-off-by: Nils-Börge Margotti <nilsmargotti@gmail.com>
1 parent cb8a2a6 commit 5d9ba06

5 files changed

Lines changed: 154 additions & 18 deletions

File tree

karma.conf.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
// Karma configuration file, see link for more information
22
// https://karma-runner.github.io/1.0/config/configuration-file.html
33

4+
const process = require('process');
5+
process.env.CHROME_BIN = require('puppeteer').executablePath();
6+
47
module.exports = function (config) {
58
config.set({
69
basePath: '',
@@ -19,13 +22,18 @@ module.exports = function (config) {
1922
dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly' ],
2023
fixWebpackSourcePaths: true
2124
},
22-
25+
customLaunchers: {
26+
ChromeNoSandbox: {
27+
base: 'Chrome',
28+
flags: ['--no-sandbox']
29+
}
30+
},
2331
reporters: ['progress', 'kjhtml'],
2432
port: 9876,
2533
colors: true,
2634
logLevel: config.LOG_INFO,
2735
autoWatch: true,
28-
browsers: ['Chrome'],
36+
browsers: ['ChromeNoSandbox'],
2937
singleRun: false
3038
});
3139
};

package-lock.json

Lines changed: 127 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
"ng-packagr": "^5.3.0",
6565
"prettier": "^1.16.4",
6666
"protractor": "^5.4.2",
67+
"puppeteer": "^1.20.0",
6768
"rxjs": "6.4.0",
6869
"standard-version": "^5.0.0",
6970
"tsickle": "^0.34.3",

src/pipes/array/filter-by.spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@ describe('FilterByPipe', () => {
5454
arr: [{ name: 'foo' }, { name: 'bar' }],
5555
current_employed: false,
5656
},
57+
{
58+
id: 5,
59+
first_name: 'George',
60+
last_name: 'Foreman',
61+
work: null,
62+
arr: [{ name: 'for' }],
63+
current_employed: false,
64+
},
5765
// tslint:enable:max-line-length
5866
];
5967

0 commit comments

Comments
 (0)