Files
Modernizr/test/node/lib/options.js
Veeck 1560f1f0dd Update Integration page (#2612)
* Show boolean value of complex tests also on the integration test page

* Fix formatting for video tests

* Cleanup integration page layout

* Update dependencies
2020-10-28 22:11:28 +01:00

35 lines
1008 B
JavaScript

var root = require('find-parent-dir').sync(__dirname, 'package.json');
var options = require(root + 'lib/options');
var chai = require('chai');
var expect = chai.expect;
var Joi = require('joi');
var schema = Joi.array().items(
Joi.object().keys({
name: Joi.string(),
property: Joi.string()
})
);
describe('cli/options', function() {
this.timeout(20000);
it('should return an array of objects in a callback', function(done) {
options(function(opts) {
var err = schema.validate(opts).error;
expect(err).to.be.equal(undefined);
done(err);
});
});
it('should return the array of objects immediately after the first run', function() {
var err = schema.validate(options()).error;
expect(err).to.be.equal(undefined);
});
it('should return all jsdoc info when the second arg is true', function() {
expect(options(null, true) !== options(null)).to.be.equal(true);
expect(options(null, true)[0].description).to.not.be.equal(undefined);
});
});