Skip to content

Commit

Permalink
tests: ignore nulls and undefined in the "util.promisify" test
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeykuzmin committed Sep 10, 2018
1 parent 2cebbc2 commit 52791e2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spec/asar-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,12 @@ describe('asar package', function () {
const {hasOwnProperty} = Object.prototype

for (const [propertyName, originalValue] of Object.entries(originalFs)) {
// Some properties exist but have a value of `undefined` on some platforms.
// E.g. `fs.lchmod`, which in only available on MacOS, see
// https://nodejs.org/docs/latest-v10.x/api/fs.html#fs_fs_lchmod_path_mode_callback
// Also check for `null`s, `hasOwnProperty()` can't handle them.
if (typeof originalValue === 'undefined' || originalValue === null) continue

if (hasOwnProperty.call(originalValue, util.promisify.custom)) {
expect(fs).to.have.own.property(propertyName)
.that.has.own.property(util.promisify.custom)
Expand Down

0 comments on commit 52791e2

Please sign in to comment.