start adding test for log view

pull/149/head
nightwing 2015-09-07 03:52:36 +04:00
rodzic d65cf411ed
commit 945322734b
3 zmienionych plików z 22 dodań i 31 usunięć

Wyświetl plik

@ -106,7 +106,7 @@
"c9.ide.run.build": "#4de6a0b9a4", "c9.ide.run.build": "#4de6a0b9a4",
"c9.ide.run.debug.xdebug": "#61dcbd0180", "c9.ide.run.debug.xdebug": "#61dcbd0180",
"c9.ide.save": "#326087f5a2", "c9.ide.save": "#326087f5a2",
"c9.ide.scm": "#30951575e3", "c9.ide.scm": "#0c01da16be",
"c9.ide.terminal.monitor": "#b52a3f2144", "c9.ide.terminal.monitor": "#b52a3f2144",
"c9.ide.theme.flat": "#2de8414db7", "c9.ide.theme.flat": "#2de8414db7",
"c9.ide.threewaymerge": "#229382aa0b", "c9.ide.threewaymerge": "#229382aa0b",

Wyświetl plik

@ -24,15 +24,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root", "events"],
"plugins/c9.ide.ui/ui", "plugins/c9.ide.ui/ui",
"plugins/c9.ide.ui/lib_apf", "plugins/c9.ide.ui/lib_apf",
"plugins/c9.fs/fs.cache.xml", "plugins/c9.fs/fs.cache.xml",
{
consumes: [],
provides: ["watcher"],
setup: function(options, imports, register) {
register(null, {
watcher: new EventEmitter()
});
}
},
{ {
packagePath: "plugins/c9.fs/fs", packagePath: "plugins/c9.fs/fs",
baseProc: baseProc baseProc: baseProc
@ -41,14 +32,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root", "events"],
"plugins/c9.vfs.client/vfs_client", "plugins/c9.vfs.client/vfs_client",
"plugins/c9.vfs.client/endpoint", "plugins/c9.vfs.client/endpoint",
"plugins/c9.ide.auth/auth", "plugins/c9.ide.auth/auth",
// Mock plugins
{
consumes: ["apf", "ui", "Plugin"],
provides: [
"auth.bootstrap", "info", "dialog.error"
],
setup: expect.html.mocked
},
{ {
consumes: ["fs.cache", "fs", "proc", "watcher"], consumes: ["fs.cache", "fs", "proc", "watcher"],
provides: [], provides: [],

Wyświetl plik

@ -4,8 +4,9 @@ require([
"lib/chai/chai", "lib/chai/chai",
"text!plugins/c9.ide.layout.classic/skins.xml", "text!plugins/c9.ide.layout.classic/skins.xml",
"events", "events",
"text!/static/standalone/skin/default/dark.css" "text!/static/standalone/skin/default/dark.css",
], function (chai, skin, events, theme) { "lib/architect/architect"
], function (chai, skin, events, theme, architect) {
"use strict"; "use strict";
var expect = chai.expect; var expect = chai.expect;
var EventEmitter = events.EventEmitter; var EventEmitter = events.EventEmitter;
@ -476,10 +477,16 @@ require([
var x = new EventEmitter(); var x = new EventEmitter();
return x; return x;
})(), })(),
"scm": (function(){
var x = new EventEmitter();
x.register = function(){};
x.unregister = function(){};
return x;
})(),
}); });
}; };
expect.setupArchitectTest = function(config, architect, options) { expect.setupArchitectTest = function(config, _, options) {
if (options && options.mockPlugins) { if (options && options.mockPlugins) {
config.push({ config.push({
consumes: [], consumes: [],
@ -490,23 +497,22 @@ require([
architect.resolveConfig(config, function(err, config) { architect.resolveConfig(config, function(err, config) {
/*global describe it before after = */ /*global describe it before after = */
if (err) throw err; if (err) throw err;
var app = window.app = architect.createApp(config, function(err, app) { var app = architect.createApp(config, function(err, app) {
if (err && err.unresolved && !config.unresolved) { if (err && err.unresolved && !config.unresolved) {
console.warn("Adding mock services for " + err.unresolved); console.warn("Adding mock services for " + err.unresolved);
config.unresolved = err.unresolved; config.unresolved = err.unresolved;
expect.setupArchitectTest(config, architect, { return expect.setupArchitectTest(config, architect, {
mockPlugins: config.unresolved mockPlugins: config.unresolved
}); });
return;
} }
if (typeof describe == "function") {
describe('app', function() { describe('app', function() {
it('should load test app', function(done) { it('should load test app', function(done) {
expect(err).not.ok; expect(err).not.ok;
done(); done();
});
}); });
}); }
onload && onload(); onload && onload();
}); });
@ -518,7 +524,9 @@ require([
app.rerun = function() { app.rerun = function() {
expect.setupArchitectTest(config, architect); expect.setupArchitectTest(config, architect);
}; };
window.app = app;
} }
return app;
}); });
}; };