Commit 54016475 by Edgar HIPP

Update tests for node v4+

parent a25ffa86
...@@ -62,6 +62,7 @@ module.exports= class ImgReplacer ...@@ -62,6 +62,7 @@ module.exports= class ImgReplacer
@qr[u]= new DocxQrCode(png,@xmlTemplater,imgName,num,@getDataFromString) @qr[u]= new DocxQrCode(png,@xmlTemplater,imgName,num,@getDataFromString)
@qr[u].decode(@imageSetter) @qr[u].decode(@imageSetter)
catch e catch e
console.error e
@imageSetter(mockedQrCode) @imageSetter(mockedQrCode)
dat= png.decode(finished) dat= png.decode(finished)
else else
......
...@@ -245,7 +245,7 @@ describe 'qrcode replacing',-> ...@@ -245,7 +245,7 @@ describe 'qrcode replacing',->
images=zip.file(/media\/.*.png/) images=zip.file(/media\/.*.png/)
expect(images.length).to.equal(3) expect(images.length).to.equal(3)
expect(images[0].asText().length).to.equal(826) expect(images[0].asText().length).to.equal(826)
expect(images[1].asText().length).to.equal(12888) expect(images[1].asText().length).to.be.within(12888, 12900)
expect(images[2].asText().length).to.be.within(17417,17440) expect(images[2].asText().length).to.be.within(17417,17440)
done() done()
...@@ -272,7 +272,7 @@ describe 'qrcode replacing',-> ...@@ -272,7 +272,7 @@ describe 'qrcode replacing',->
images=zip.file(/media\/.*.png/) images=zip.file(/media\/.*.png/)
expect(images.length).to.equal(3) expect(images.length).to.equal(3)
expect(images[0].asText().length).to.equal(826) expect(images[0].asText().length).to.equal(826)
expect(images[1].asText().length).to.equal(12888) expect(images[1].asText().length).to.be.within(12888, 12900)
expect(images[2].asText().length).to.be.within(17417,17440) expect(images[2].asText().length).to.be.within(17417,17440)
done() done()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment