Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-9498

FileReader.prototype.readAsText runs malfunctionnally in mobilespec

    XMLWordPrintableJSON

    Details

      Description

      When running tests of cordova-plugin-file with Mobilespec, file.spec.83 failed. Error messages are listed below:

      Error: Expected null to be 'asdfasdf'.
      at stack(file:///android_asset/www/cdvtests/jasmine-2.0.0/jasmine.js:1292:17)
      at buildExpectationResult(file:///android_asset/www/cdvtests/jasmine-2.0.0/jasmine.js:1269:14)
      at Spec.Env.expectationResultFactory(file:///android_asset/www/cdvtests/jasmine-2.0.0/jasmine.js:483:18)
      at Spec.addExpectationResult(file:///android_asset/www/cdvtests/jasmine-2.0.0/jasmine.js:259:46)
      at Expectation.addExpectationResult(file:///android_asset/www/cdvtests/jasmine-2.0.0/jasmine.js/441:21)
      at Expectation.toBe(file:///android_asset/www/cdvtests/jasmine-2.0.0/jasmine.js:1208:12)
      at FileReader.verifier(file:///android_asset/www/plugins/cordova-plugin-file-tests/tests.js:2190:47)

      When looking into the source code FileReader.js, it is found that readAsText is overrided. However, this function didn't return the expected result we want. And this problem happens only in tests. In daily usage, such problems don't appear.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              donghl Dong Hanlin
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: