-
Notifications
You must be signed in to change notification settings - Fork 612
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixing options to all methods. fixing bug wher eoptions were not rend…
…ered. adding url test for ec level L
- Loading branch information
Showing
8 changed files
with
92 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,4 +39,4 @@ complete = function(){ | |
console.log('build complete =)'); | ||
}; | ||
|
||
done(); | ||
done(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,26 @@ | ||
// simple test | ||
var test = require('tap').test; | ||
|
||
// simple tdest | ||
var QRCode = require(__dirname+'/../qrcode.js'); | ||
|
||
var shouldBe = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIwAAACMCAIAAAAhotZpAAAABmJLR0QA/wD/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wD/AP+gvaeTAAACMklEQVR4nO3dwW4CMQwA0W7F///yckO5RIpleyeBeceKFjSK3G0I2+u+7z89659+Ab/I6ACjA4wOMDrA6ACjA4wOMDrA6ACjA4wOMDrA6ACjA4wOMDrA6ACjA16Zb76uq+p1fKy8Zzs+7/j4la9Xyby37EoHGB1gdEBqpo8yMy46czPP9eTrnHGlA4wOMDqgbKaPVmZfx/V4dF5Xvc4oVzrA6ACjA1pmepXZPJ19fTbrd+NKBxgdYHTA1jN99OReeTdXOsDoAKMDWmZ69zXybI5Hn5e6lnelA4wOMDqgbKZ3XC9nzres7M9QXOkAowOMDkjN9N32rKP77xRXOsDoAKMD2s+nP7n33X3epoorHWB0gNEBZdfpVfsk0bnfsQ+z8nr8zNFhjA4wOuDRcy9V8zc6czN/T3T8neFKBxgdYHTAVbW3EJ2tmc8HZa6jdzjD7koHGB1gdAB2lrHjd0D0MdR8d6UDjA4wOqDsOr1D1X1gMj/H/fQvYXSA0QHH3Jex6tp/5fHd53Nc6QCjA4wOOOa+jCvzuuNzpB37M650gNEBRgdsfV/G6PdG56/76T/E6ACjA7a+h9dsXztzhr3j8VGudIDRAUYHbD3Tq/bHV97z7D6LOXKlA4wOMDrgmPsydvxPjKr7gkW50gFGBxgdsPV9GWcye+WZee11+sGMDjA6YOvz6d/KlQ4wOsDoAKMDjA4wOsDoAKMDjA4wOsDoAKMDjA4wOsDoAKMDjA4wOsDogDcjgAwAvM5/aQAAAABJRU5ErkJggg=="; | ||
|
||
test('qrcode to data uri should be correct.',function(t){ | ||
QRCode.toDataURL('i am a pony!',function(err,url){ | ||
if(err) console.log(err); | ||
t.ok(!err,'there should be no error '+err); | ||
t.equals(url,shouldBe,"url generated should match expected value"); | ||
t.end(); | ||
}); | ||
|
||
}); | ||
|
||
QRCode.toDataURL('i am a pony!',function(err,url){ | ||
if(err) console.log(err); | ||
console.log(url == shouldBe?"PASS: url is what it should be !\n":"FAIL: oh no something broke the qr generation!\n"); | ||
test('qrcode generated with changed error correction should be expected value',function(t){ | ||
QRCode.toDataURL('i am a pony!',{errorCorrectLevel:'L'},function(err,url){ | ||
t.ok(!err,'there should be no error '+err); | ||
t.equals(url,lShouldBe,"url should match expected value for error correction L"); | ||
t.end(); | ||
}); | ||
}); |