ember-introjs
Version:
An Ember Component for intro.js
32 lines (23 loc) • 976 B
JavaScript
;
const path = require('path');
const pathUtil = require('ember-cli-path-utils');
const stringUtils = require('ember-cli-string-utils');
const existsSync = require('exists-sync');
const useTestFrameworkDetector = require('../test-framework-detector');
module.exports = useTestFrameworkDetector({
description: 'Generates an acceptance test for a feature.',
locals: function(options) {
let testFolderRoot = stringUtils.dasherize(options.project.name());
if (options.project.isEmberCLIAddon()) {
testFolderRoot = pathUtil.getRelativeParentPath(options.entity.name, -1, false);
}
let destroyAppExists =
existsSync(path.join(this.project.root, '/tests/helpers/destroy-app.js'));
let friendlyTestName = ['Acceptance', stringUtils.dasherize(options.entity.name).replace(/[-]/g,' ')].join(' | ');
return {
testFolderRoot: testFolderRoot,
friendlyTestName,
destroyAppExists: destroyAppExists
};
}
});