maidsafe-archive / safe_app_nodejs

BSD 3-Clause "New" or "Revised" License
28 stars 23 forks source link

chore/deps: upgrades Node-FFI to v2.3.0 and Nodejs to v10 #341

Closed hunterlester closed 5 years ago

hunterlester commented 5 years ago

The purpose of this is to be able to upgrade to Electron v4.0.0 in SAFE Browser

Resolves #305

coveralls commented 5 years ago

Coverage Status

Coverage remained the same at 96.488% when pulling 652944bfbdb72093202a5c080cf5d666ba26c4f2 on hunterlester:ffi into 83a5bc47575270723c2fa748cde104d0ec770250 on maidsafe:master.

joshuef commented 5 years ago

I'm seeing some tests failing with node 10 on OSX. (though not many).

As this update facilitates 10, can you see how node 10 goers for you on windows, @hunterlester ? If we can have compat for node 8/9/10, that would be rad.

errors I'm seeing are purely related to node error wording being throw, which I guess has changed in node 10:

1) Smoke test is rejected if options object contains non-string configPath value:
     AssertionError: expected [Promise] to be rejected with a message matching 'Failed to set additional config search path. Reason: TypeError: error setting argument 0 - "string" must be a string, Buffer, or ArrayBuffer', but got 'Failed to set additional config search path. Reason: TypeError [ERR_INVALID_ARG_TYPE]: error setting argument 0 - The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type object'
      at next$onError (node_modules/should/cjs/should.js:1696:12)

  2) Encryption keys two app encryption throws error if decryptSealed not provided with cipher:
     AssertionError: expected [Promise] to be rejected with a message matching 'First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.', but got 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type undefined'
      at next$onError (node_modules/should/cjs/should.js:1696:12)

  3) NFS emulation throws error if invalid user metadata type is passed while updating file:
     AssertionError: expected Function { name: 'test' } to throw exception with a message matching 'First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.', but got 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type object'
      at Assertion.fail (node_modules/should/cjs/should.js:258:17)
      at Assertion.value (node_modules/should/cjs/should.js:335:19)
      at Context.it (test/nfs.js:249:30)

  4) NFS emulation throws error if invalid user metadata type is passed while inserting file:
     AssertionError: expected Function { name: 'test' } to throw exception with a message matching '"value" argument must not be a number', but got 'The "value" argument must not be of type number. Received type number'
joshuef commented 5 years ago

I've setup a PR https://github.com/hunterlester/safe_app_nodejs/pull/2 updating the test regex, which is failing as it differs between node versions.