You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
748 B
27 lines
748 B
'use strict';
|
|
|
|
if (process.browser || true) // no examples yet
|
|
return; //examples are loaded from files, which doesn't work in the browser
|
|
|
|
var should = require('chai').should();
|
|
var fs = require('fs');
|
|
|
|
describe('Examples', function() {
|
|
|
|
var filenames = fs.readdirSync(__dirname + '/../examples/');
|
|
|
|
filenames.forEach(function(filename) {
|
|
if (filename.slice(filename.length - 3) === '.js') {
|
|
describe(filename, function() {
|
|
it('should not throw any errors', function() {
|
|
(function() {
|
|
var save = console.log;
|
|
console.log = function() {};
|
|
require('../examples/' + filename);
|
|
console.log = save;
|
|
}).should.not.throw();
|
|
});
|
|
});
|
|
}
|
|
});
|
|
});
|
|
|