ember-cli
Version:
Command line tool for developing ambitious ember.js apps
69 lines (57 loc) • 1.19 kB
JavaScript
const Project = require('../../lib/models/project');
const Instrumentation = require('../../lib/models/instrumentation');
const MockUI = require('console-ui/mock');
class MockProject extends Project {
constructor(options = {}) {
let root = options.root || process.cwd();
let pkg = options.pkg || {};
let ui = options.ui || new MockUI();
let instr = new Instrumentation({
ui,
initInstrumentation: {
token: null,
node: null,
},
});
let cli = options.cli || {
instrumentation: instr,
};
super(root, pkg, ui, cli);
}
require(file) {
if (file === './server') {
return function () {
return {
listen() {
arguments[arguments.length - 1]();
},
};
};
}
}
config() {
return (
this._config || {
rootURL: '/',
locationType: 'history',
}
);
}
has(key) {
return /server/.test(key);
}
name() {
return 'mock-project';
}
hasDependencies() {
return true;
}
dependencies() {
return [];
}
isEmberCLIAddon() {
return false;
}
}
module.exports = MockProject;
;