* Split core lib into multiple files * Refactor data encoding methods * Refactor data masking process * Improve qr code generation process * Increase minimum required node version to 0.10 * Add linter * Add tests and tests coverage * Update travis config to fix compilation issues * Add examples folder * Add missing license tag in package.json * Update build script and add sourcemap support * Publish only strictly needed files on npm * Update readme
15 lines
434 B
JavaScript
15 lines
434 B
JavaScript
var test = require('tap').test
|
|
var fs = require('fs')
|
|
var path = require('path')
|
|
var QRCode = require('../../')
|
|
|
|
test('drawSvg', function (t) {
|
|
var expectedSvg = fs.readFileSync(path.join(__dirname, '/fixtures/expected-output.svg'), 'UTF-8')
|
|
|
|
QRCode.drawSvg('http://www.google.com', function (err, code) {
|
|
t.ok(!err, 'there should be no error')
|
|
t.equal(code, expectedSvg, 'should output a valid svg')
|
|
|
|
t.end()
|
|
})
|
|
})
|