pixsy/node_modules/pug/test/examples.test.js

24 lines
587 B
JavaScript
Raw Normal View History

2017-12-22 17:22:08 +00:00
'use strict';
var fs = require('fs');
var pug = require('../');
describe('examples', function () {
fs.readdirSync(__dirname + '/../examples').forEach(function (example) {
if (/\.js$/.test(example)) {
it(example + ' does not throw any error', function () {
var log = console.log;
var err = console.error;
console.log = function () {};
console.error = function () {};
try {
require('../examples/' + example);
} finally {
console.log = log;
console.error = err;
}
});
}
});
});