• passes: 4
  • failures: 0
  • duration: 0.03s
  • Loading

    • Return the img element or FileReader object to allow aborting the image load1ms ‣

      var img = loadImage(blobGIF, function () {})
      expect(img).to.be.an.instanceOf(Object)
      expect(img.onload).to.be.a('function')
      expect(img.onerror).to.be.a('function')
    • Load image url5ms ‣

      expect(
        loadImage(imageUrlGIF, function (img) {
          expect(img.width).to.equal(80)
          expect(img.height).to.equal(60)
          done()
        })
      ).to.be.ok
    • Load image blob2ms ‣

      expect(
        loadImage(blobGIF, function (img) {
          expect(img.width).to.equal(80)
          expect(img.height).to.equal(60)
          done()
        })
      ).to.be.ok
    • Return image loading error to callback9ms ‣

      expect(
        loadImage('404', function (img) {
          expect(img).to.be.an.instanceOf(window.Event)
          expect(img.type).to.equal('error')
          done()
        })
      ).to.be.ok