jasmine-spec-factory
Version:
An opinionated Jasmine spec generator for AMD modules.
23 lines (16 loc) • 530 B
JavaScript
;
const fs = require('fs');
const path = require('path');
module.exports = class Templates {
static get() {
let templates = ['moduleSpec.hbs', '_methodSpec.hbs', '_returnsUndefined.hbs', '_varSpec.hbs'];
return templates.map(Templates.getTemplate);
}
static getPath() {
return path.join(__dirname, '..', 'templates');
}
static getTemplate(template) {
let path = Templates.getPath();
return fs.readFileSync(`${path}/${template}`).toString();
}
};