mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-03-04 02:02:39 -05:00
23 lines
535 B
JavaScript
23 lines
535 B
JavaScript
|
var assert = require('assert')
|
||
|
, fs = require('fs')
|
||
|
, YAML = require('js-yaml')
|
||
|
, jju = require('../')
|
||
|
|
||
|
function addTest(name, fn) {
|
||
|
if (typeof(describe) === 'function') {
|
||
|
it(name, fn)
|
||
|
} else {
|
||
|
fn()
|
||
|
}
|
||
|
}
|
||
|
|
||
|
fs.readdirSync(__dirname + '/update').filter(function(file) {
|
||
|
return file.match(/^[^\.].*\.yaml$/)
|
||
|
}).forEach(function(file) {
|
||
|
addTest('update: ' + file, function() {
|
||
|
var test = YAML.load(fs.readFileSync(__dirname + '/update/' + file, 'utf8'))
|
||
|
assert.strictEqual(test.test(jju, test.input), test.output)
|
||
|
})
|
||
|
})
|
||
|
|