* switch from custom eslint config to standard + prettier * fix new standard eslint violations * add editorconfig file * auto-fix all other violations * update lint yarn script * remove jshint comment
50 lines
1.1 KiB
JavaScript
50 lines
1.1 KiB
JavaScript
/* eslint-env mocha */
|
|
/* eslint-disable no-console */
|
|
/**
|
|
* Class representing a YAML file
|
|
* @type {[type]}
|
|
*/
|
|
module.exports = YamlFile;
|
|
|
|
var YamlDoc = require('./yaml_doc');
|
|
var clientManager = require('./client_manager');
|
|
var _ = require('lodash');
|
|
var async = require('async');
|
|
|
|
function YamlFile(filename, docs) {
|
|
var file = this;
|
|
|
|
// file level skipping flag
|
|
file.skipping = false;
|
|
|
|
describe(filename, function() {
|
|
file.docs = _.map(docs, function(doc) {
|
|
doc = new YamlDoc(doc, file);
|
|
if (doc.description === 'setup') {
|
|
beforeEach(
|
|
/* doc */ function(done) {
|
|
async.series(doc.getActionsRunners(), done);
|
|
}
|
|
);
|
|
} else {
|
|
it(doc.description, function(done) {
|
|
async.series(doc.getActionsRunners(), done);
|
|
});
|
|
}
|
|
});
|
|
|
|
afterEach(
|
|
/* doc */ function() {
|
|
clientManager
|
|
.get()
|
|
.transport.log.debug(
|
|
'===========================\n' +
|
|
'Cleanup\n' +
|
|
'==========================='
|
|
);
|
|
return clientManager.get().clearEs();
|
|
}
|
|
);
|
|
});
|
|
}
|