From: Kevin Sawicki Date: Fri, 17 Mar 2017 17:28:23 +0000 (-0700) Subject: Add spec for remote function with toString property X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=648d3324fb84fd243850f55ea1a22f5499a76527;p=platform%2Fframework%2Fweb%2Fcrosswalk-tizen.git Add spec for remote function with toString property --- diff --git a/spec/api-ipc-spec.js b/spec/api-ipc-spec.js index f86d065..47f2eef 100644 --- a/spec/api-ipc-spec.js +++ b/spec/api-ipc-spec.js @@ -163,8 +163,11 @@ describe('ipc module', function () { }) it('returns toString() of original function via toString()', function () { - var readText = remote.clipboard.readText + const {readText} = remote.clipboard assert(readText.toString().startsWith('function')) + + var {functionWithToStringProperty} = remote.require(path.join(fixtures, 'module', 'to-string-non-function.js')) + assert.equal(functionWithToStringProperty.toString, 'hello') }) }) diff --git a/spec/fixtures/module/to-string-non-function.js b/spec/fixtures/module/to-string-non-function.js new file mode 100644 index 0000000..3e91921 --- /dev/null +++ b/spec/fixtures/module/to-string-non-function.js @@ -0,0 +1,4 @@ +function hello () { +} +hello.toString = 'hello' +module.exports = {functionWithToStringProperty: hello}