kopia lustrzana https://github.com/c9/core
cleanup tests
rodzic
64034389ec
commit
64d8f259dc
|
@ -32,6 +32,7 @@ describe("client config consistency", function() {
|
|||
}).concat(
|
||||
fs.readdirSync(root + "/configs/ide").map(function(n) { return "ide/" + n })
|
||||
).forEach(function(name) {
|
||||
if (!/\.js$/.test(name)) return;
|
||||
it("should not have missing plugins in config " + name, function(next) {
|
||||
fetchClientOptions(function(err, clientOptions) {
|
||||
if (err) return next();
|
||||
|
|
|
@ -45,16 +45,18 @@ module.exports = function(config, optimist) {
|
|||
.describe("useBrowserCache", "Use window.caches api if available for faster loading, requires https://")
|
||||
.describe("secure", "path to file containing ssl certificate (can be generated using scripts/create-cert.sh)");
|
||||
}
|
||||
|
||||
|
||||
require("./utils/ssl")(config, optimist);
|
||||
|
||||
var argv = optimist.argv;
|
||||
if (argv.help)
|
||||
return null;
|
||||
|
||||
|
||||
var testing = argv.t;
|
||||
var baseProc = path.normalize(testing
|
||||
? __dirname + "/../plugins/c9.fs/mock"
|
||||
: argv.w || (__dirname + "/../"));
|
||||
|
||||
|
||||
// if (testing && !argv["setting-path"])
|
||||
// argv["setting-path"] = "/tmp/.c9";
|
||||
|
||||
|
@ -112,15 +114,6 @@ module.exports = function(config, optimist) {
|
|||
console.log("or use -a username:password to setup HTTP authentication\n");
|
||||
}
|
||||
|
||||
if (argv.secure) {
|
||||
var certPath = path.isAbsolute(argv.secure) ? argv.secure : path.join(__dirname, "..", argv.secure);
|
||||
var key = require("fs").readFileSync(certPath, "utf8");
|
||||
config.secure = {
|
||||
key: key.match(/^(-+BEGIN RSA PRIVATE KEY[\s\S]*END RSA PRIVATE KEY-+)/m)[0],
|
||||
cert: key.match(/^(-+BEGIN CERTIFICATE[\s\S]*END CERTIFICATE-+)/m)[0],
|
||||
};
|
||||
}
|
||||
|
||||
var plugins = [
|
||||
{
|
||||
packagePath: "connect-architect/connect",
|
||||
|
|
|
@ -84,6 +84,6 @@ require(["lib/architect/architect", "lib/chai/chai"], function (architect, chai)
|
|||
});
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -213,6 +213,6 @@ require(["lib/architect/architect", "lib/chai/chai"], function (architect, chai)
|
|||
});
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -31,6 +31,6 @@ require(["lib/architect/architect", "lib/chai/chai"], function (architect, chai)
|
|||
});
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -18,6 +18,7 @@ require(["lib/architect/architect", "lib/chai/chai"], function (architect, chai)
|
|||
"plugins/c9.vfs.client/vfs_client",
|
||||
"plugins/c9.vfs.client/endpoint",
|
||||
"plugins/c9.ide.auth/auth",
|
||||
"plugins/c9.core/api",
|
||||
"plugins/c9.core/ext",
|
||||
"plugins/c9.core/http-xhr",
|
||||
"plugins/c9.ide.ui/lib_apf",
|
||||
|
@ -27,7 +28,6 @@ require(["lib/architect/architect", "lib/chai/chai"], function (architect, chai)
|
|||
debug: true
|
||||
},
|
||||
"plugins/c9.ide.ui/ui",
|
||||
"plugins/c9.core/api",
|
||||
{
|
||||
consumes: ["settings"],
|
||||
provides: [],
|
||||
|
@ -108,6 +108,6 @@ require(["lib/architect/architect", "lib/chai/chai"], function (architect, chai)
|
|||
});
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -71,6 +71,6 @@ require(["lib/architect/architect", "lib/chai/chai"], function (architect, chai)
|
|||
});
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -1,13 +1,11 @@
|
|||
/*global describe it before*/
|
||||
|
||||
"use blacklist";
|
||||
"use client";
|
||||
|
||||
require(["lib/architect/architect", "lib/chai/chai", "/vfs-root", "events"],
|
||||
function (architect, chai, baseProc, events) {
|
||||
require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
||||
function (architect, chai, baseProc) {
|
||||
var expect = chai.expect;
|
||||
var EventEmitter = events.EventEmitter;
|
||||
|
||||
|
||||
expect.setupArchitectTest([
|
||||
{
|
||||
packagePath: "plugins/c9.core/c9",
|
||||
|
@ -21,7 +19,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root", "events"],
|
|||
"plugins/c9.core/ext",
|
||||
"plugins/c9.core/settings",
|
||||
"plugins/c9.core/util",
|
||||
"plugins/c9.core/api",
|
||||
"plugins/c9.ide.ui/ui",
|
||||
"plugins/c9.ide.ui/lib_apf",
|
||||
"plugins/c9.fs/fs.cache.xml",
|
||||
|
@ -33,6 +30,7 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root", "events"],
|
|||
"plugins/c9.vfs.client/vfs_client",
|
||||
"plugins/c9.vfs.client/endpoint",
|
||||
"plugins/c9.ide.auth/auth",
|
||||
"plugins/c9.core/api",
|
||||
{
|
||||
consumes: ["fs.cache", "fs", "proc", "watcher"],
|
||||
provides: [],
|
||||
|
@ -845,6 +843,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root", "events"],
|
|||
});
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -9,7 +9,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
expect.setupArchitectTest([
|
||||
"plugins/c9.core/http-xhr",
|
||||
"plugins/c9.core/ext",
|
||||
"plugins/c9.core/api",
|
||||
{
|
||||
packagePath: "plugins/c9.fs/fs",
|
||||
baseProc: baseProc
|
||||
|
@ -17,6 +16,7 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
"plugins/c9.vfs.client/vfs_client",
|
||||
"plugins/c9.vfs.client/endpoint",
|
||||
"plugins/c9.ide.auth/auth",
|
||||
"plugins/c9.core/api",
|
||||
|
||||
{
|
||||
consumes: ["fs"],
|
||||
|
@ -49,12 +49,13 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
|
||||
describe('fs.readFile()', function() {
|
||||
it("should read the text file", function(done) {
|
||||
fs.readFile("/file.txt", "utf8", function(err, body) {
|
||||
var xhr = fs.readFile("/file.txt", "utf8", function(err, body) {
|
||||
if (err) throw err.message;
|
||||
expect(body).equal("This is a simple file!\n");
|
||||
expect(body.length).equal(23);
|
||||
done();
|
||||
});
|
||||
expect(xhr.abort).to.ok;
|
||||
});
|
||||
it("should error with ENOENT on missing files", function(done) {
|
||||
fs.readFile("/badfile.json", "utf8", function(err, body) {
|
||||
|
@ -63,9 +64,29 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
});
|
||||
});
|
||||
it("should error with EISDIR on directories", function(done) {
|
||||
var called;
|
||||
fs.once("userError", function() {
|
||||
if (called)
|
||||
done();
|
||||
});
|
||||
fs.readFile("/", "utf8", function(err, body) {
|
||||
expect(err).property("code").equal("EISDIR");
|
||||
done();
|
||||
called = true;
|
||||
});
|
||||
});
|
||||
it("should not emit userError if error is handled", function(done) {
|
||||
function onError() {
|
||||
fs.off("userError", onError);
|
||||
done(new Error("userError emitted"));
|
||||
}
|
||||
fs.on("userError", onError);
|
||||
fs.readFile("/", "utf8", function(err, body) {
|
||||
expect(err).property("code").equal("EISDIR");
|
||||
setTimeout(function() {
|
||||
fs.off("userError", onError);
|
||||
done();
|
||||
});
|
||||
return false;
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -545,6 +566,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -20,6 +20,7 @@ require(["lib/architect/architect", "lib/chai/chai"], function (architect, chai)
|
|||
"plugins/c9.vfs.client/vfs_client",
|
||||
"plugins/c9.vfs.client/endpoint",
|
||||
"plugins/c9.ide.auth/auth",
|
||||
"plugins/c9.core/api",
|
||||
|
||||
{
|
||||
consumes: ["net", "proc"],
|
||||
|
@ -71,6 +72,6 @@ require(["lib/architect/architect", "lib/chai/chai"], function (architect, chai)
|
|||
});
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -20,6 +20,7 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"], function (arc
|
|||
"plugins/c9.vfs.client/vfs_client",
|
||||
"plugins/c9.vfs.client/endpoint",
|
||||
"plugins/c9.ide.auth/auth",
|
||||
"plugins/c9.core/api",
|
||||
{
|
||||
consumes: ["proc", "c9"],
|
||||
provides: [],
|
||||
|
@ -158,6 +159,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"], function (arc
|
|||
});
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -23,7 +23,6 @@ require(["lib/architect/architect", "lib/chai/chai"], function (architect, chai)
|
|||
packagePath: "plugins/c9.core/settings",
|
||||
settings: { user: { general: { animateui: true }}}
|
||||
},
|
||||
"plugins/c9.core/api.js",
|
||||
"plugins/c9.ide.ui/lib_apf",
|
||||
"plugins/c9.ide.ui/anims",
|
||||
"plugins/c9.ide.ui/menus",
|
||||
|
@ -52,6 +51,7 @@ require(["lib/architect/architect", "lib/chai/chai"], function (architect, chai)
|
|||
"plugins/c9.vfs.client/vfs_client",
|
||||
"plugins/c9.vfs.client/endpoint",
|
||||
"plugins/c9.ide.auth/auth",
|
||||
"plugins/c9.core/api",
|
||||
"plugins/c9.fs/fs",
|
||||
|
||||
// Mock plugins
|
||||
|
@ -183,6 +183,6 @@ require(["lib/architect/architect", "lib/chai/chai"], function (architect, chai)
|
|||
}
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -25,7 +25,6 @@ require(["lib/architect/architect", "lib/chai/chai"], function (architect, chai)
|
|||
packagePath: "plugins/c9.core/settings",
|
||||
testing: true
|
||||
},
|
||||
"plugins/c9.core/api.js",
|
||||
{
|
||||
packagePath: "plugins/c9.ide.ui/ui",
|
||||
staticPrefix: "plugins/c9.ide.ui"
|
||||
|
@ -180,6 +179,6 @@ require(["lib/architect/architect", "lib/chai/chai"], function (architect, chai)
|
|||
}
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -26,7 +26,6 @@ require(["lib/architect/architect", "lib/chai/chai"], function (architect, chai)
|
|||
settings: "default",
|
||||
testing: true
|
||||
},
|
||||
"plugins/c9.core/api.js",
|
||||
{
|
||||
packagePath: "plugins/c9.ide.ui/ui",
|
||||
staticPrefix: "plugins/c9.ide.ui"
|
||||
|
@ -51,6 +50,7 @@ require(["lib/architect/architect", "lib/chai/chai"], function (architect, chai)
|
|||
"plugins/c9.vfs.client/vfs_client",
|
||||
"plugins/c9.vfs.client/endpoint",
|
||||
"plugins/c9.ide.auth/auth",
|
||||
"plugins/c9.core/api",
|
||||
"plugins/c9.fs/fs",
|
||||
|
||||
"plugins/c9.ide.dialog/dialog",
|
||||
|
@ -450,6 +450,9 @@ require(["lib/architect/architect", "lib/chai/chai"], function (architect, chai)
|
|||
done();
|
||||
});
|
||||
it('should allow setting behavioursEnabled', function(done) {
|
||||
editor.setOption("syntax", "javascript");
|
||||
expect(editor.ace.session.$mode.$id).to.equal("ace/mode/javascript");
|
||||
|
||||
editor.setOption("behavioursEnabled", false);
|
||||
doc.value = "test";
|
||||
render();
|
||||
|
@ -552,6 +555,6 @@ require(["lib/architect/architect", "lib/chai/chai"], function (architect, chai)
|
|||
}
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -70,6 +70,6 @@ require(["lib/architect/architect", "lib/chai/chai"], function (architect, chai)
|
|||
}
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -24,7 +24,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
"plugins/c9.core/ext",
|
||||
"plugins/c9.core/http-xhr",
|
||||
"plugins/c9.core/util",
|
||||
"plugins/c9.core/api.js",
|
||||
"plugins/c9.ide.ui/lib_apf",
|
||||
{
|
||||
packagePath: "plugins/c9.core/settings",
|
||||
|
@ -49,6 +48,7 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
"plugins/c9.vfs.client/vfs_client",
|
||||
"plugins/c9.vfs.client/endpoint",
|
||||
"plugins/c9.ide.auth/auth",
|
||||
"plugins/c9.core/api",
|
||||
{
|
||||
packagePath: "plugins/c9.fs/fs",
|
||||
baseProc: baseProc
|
||||
|
|
|
@ -26,7 +26,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
packagePath: "plugins/c9.core/settings",
|
||||
testing: true
|
||||
},
|
||||
"plugins/c9.core/api.js",
|
||||
{
|
||||
packagePath: "plugins/c9.ide.ui/ui",
|
||||
staticPrefix: "plugins/c9.ide.ui"
|
||||
|
@ -53,6 +52,7 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
"plugins/c9.vfs.client/vfs_client",
|
||||
"plugins/c9.vfs.client/endpoint",
|
||||
"plugins/c9.ide.auth/auth",
|
||||
"plugins/c9.core/api",
|
||||
{
|
||||
packagePath: "plugins/c9.fs/fs",
|
||||
baseProc: baseProc
|
||||
|
@ -87,9 +87,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
|
||||
describe('console', function() {
|
||||
before(function(done) {
|
||||
apf.config.setProperty("allow-select", false);
|
||||
apf.config.setProperty("allow-blur", false);
|
||||
|
||||
document.documentElement.style.paddingBottom = "200px";
|
||||
|
||||
cnsl.once("ready", function() {
|
||||
|
@ -379,6 +376,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
});
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -61,6 +61,6 @@ require(["lib/architect/architect", "lib/chai/chai"], function (architect, chai)
|
|||
});
|
||||
}
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -71,6 +71,6 @@ require(["lib/architect/architect", "lib/chai/chai"], function (architect, chai)
|
|||
});
|
||||
}
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -89,6 +89,6 @@ require(["lib/architect/architect", "lib/chai/chai"], function (architect, chai)
|
|||
});
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -134,6 +134,6 @@ require(["lib/architect/architect", "lib/chai/chai"], function (architect, chai)
|
|||
});
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -77,6 +77,6 @@ require(["lib/architect/architect", "lib/chai/chai", "events"], function (archit
|
|||
});
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -1,4 +1,4 @@
|
|||
/*global describe it before after bar*/
|
||||
/*global describe it before after bar apf*/
|
||||
|
||||
"use client";
|
||||
|
||||
|
@ -26,7 +26,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
packagePath: "plugins/c9.core/settings",
|
||||
testing: true
|
||||
},
|
||||
"plugins/c9.core/api.js",
|
||||
{
|
||||
packagePath: "plugins/c9.ide.ui/ui",
|
||||
staticPrefix: "plugins/c9.ide.ui"
|
||||
|
@ -53,6 +52,7 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
},
|
||||
"plugins/c9.vfs.client/endpoint",
|
||||
"plugins/c9.ide.auth/auth",
|
||||
"plugins/c9.core/api",
|
||||
"plugins/c9.fs/proc",
|
||||
{
|
||||
packagePath: "plugins/c9.fs/fs",
|
||||
|
@ -84,14 +84,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
var metadata = imports.metadata;
|
||||
var question = imports["dialog.question"];
|
||||
|
||||
function countEvents(count, expected, done) {
|
||||
if (count == expected)
|
||||
done();
|
||||
else
|
||||
throw new Error("Wrong Event Count: "
|
||||
+ count + " of " + expected);
|
||||
}
|
||||
|
||||
expect.html.setConstructor(function(tab) {
|
||||
if (typeof tab == "object")
|
||||
return tab.pane.aml.getPage("editor::" + tab.editorType).$ext;
|
||||
|
@ -447,6 +439,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
}
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -113,6 +113,6 @@ require(["lib/architect/architect", "lib/chai/chai"], function (architect, chai)
|
|||
});
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -24,7 +24,6 @@ require(["lib/architect/architect", "lib/chai/chai"],
|
|||
packagePath: "plugins/c9.core/settings",
|
||||
testing: true
|
||||
},
|
||||
"plugins/c9.core/api.js",
|
||||
{
|
||||
packagePath: "plugins/c9.ide.ui/ui",
|
||||
staticPrefix: "plugins/c9.ide.ui"
|
||||
|
@ -48,6 +47,7 @@ require(["lib/architect/architect", "lib/chai/chai"],
|
|||
},
|
||||
"plugins/c9.vfs.client/endpoint",
|
||||
"plugins/c9.ide.auth/auth",
|
||||
"plugins/c9.core/api",
|
||||
{
|
||||
packagePath: "plugins/c9.fs/fs",
|
||||
baseProc: baseProc
|
||||
|
@ -593,6 +593,6 @@ require(["lib/architect/architect", "lib/chai/chai"],
|
|||
}
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -141,6 +141,6 @@ require(["lib/architect/architect", "lib/chai/chai"], function (architect, chai)
|
|||
});
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -31,7 +31,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
packagePath: "plugins/c9.core/settings",
|
||||
settings: { user: { general: { animateui: true }}}
|
||||
},
|
||||
"plugins/c9.core/api.js",
|
||||
{
|
||||
packagePath: "plugins/c9.ide.ui/ui",
|
||||
staticPrefix: "plugins/c9.ide.ui"
|
||||
|
@ -73,6 +72,7 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
},
|
||||
"plugins/c9.vfs.client/endpoint",
|
||||
"plugins/c9.ide.auth/auth",
|
||||
"plugins/c9.core/api",
|
||||
"plugins/c9.fs/fs",
|
||||
|
||||
{
|
||||
|
@ -111,7 +111,7 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
});
|
||||
|
||||
describe("open", function() {
|
||||
it('should open a pane with just an editor', function(done) {
|
||||
it("should open searchresults tab", function(done) {
|
||||
findinfiles.toggle();
|
||||
tabs.open({ path: "/file.txt", focus: true }, function(err, tab) {
|
||||
expect(tabs.getTabs()).length.is.gte(1);
|
||||
|
@ -126,8 +126,7 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
|
||||
if (!onload.remain) {
|
||||
describe("unload", function() {
|
||||
|
||||
it('should open a pane with just an editor', function(done) {
|
||||
it('should unload find in files plugin', function(done) {
|
||||
findinfiles.unload();
|
||||
done();
|
||||
});
|
||||
|
@ -142,6 +141,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
}
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -26,7 +26,6 @@ require(["lib/architect/architect", "lib/chai/chai", "text!plugins/c9.ide.layout
|
|||
packagePath: "plugins/c9.core/settings",
|
||||
settings: { user: { general: { animateui: true }}}
|
||||
},
|
||||
"plugins/c9.core/api.js",
|
||||
{
|
||||
packagePath: "plugins/c9.ide.ui/ui",
|
||||
staticPrefix: "plugins/c9.ide.ui"
|
||||
|
@ -57,8 +56,9 @@ require(["lib/architect/architect", "lib/chai/chai", "text!plugins/c9.ide.layout
|
|||
"plugins/c9.vfs.client/vfs_client",
|
||||
"plugins/c9.vfs.client/endpoint",
|
||||
"plugins/c9.ide.auth/auth",
|
||||
"plugins/c9.core/api",
|
||||
"plugins/c9.fs/fs",
|
||||
|
||||
|
||||
{
|
||||
consumes: ["ui"],
|
||||
provides: ["layout"],
|
||||
|
@ -102,38 +102,36 @@ require(["lib/architect/architect", "lib/chai/chai", "text!plugins/c9.ide.layout
|
|||
setup: main
|
||||
}
|
||||
], architect);
|
||||
|
||||
|
||||
function main(options, imports, register) {
|
||||
var tabs = imports.tabManager;
|
||||
var settings = imports.settings;
|
||||
var findreplace = imports.findreplace;
|
||||
var commands = imports.commands;
|
||||
|
||||
|
||||
var Range = require("ace/range").Range;
|
||||
|
||||
|
||||
var txtFind, txtReplace;
|
||||
|
||||
|
||||
function getTabHtml(tab) {
|
||||
return tab.pane.aml.getPage("editor::" + tab.editorType).$ext;
|
||||
}
|
||||
|
||||
|
||||
expect.html.setConstructor(function(tab) {
|
||||
if (typeof tab == "object")
|
||||
return getTabHtml(tab);
|
||||
});
|
||||
|
||||
|
||||
describe('ace', function() {
|
||||
this.timeout(10000);
|
||||
|
||||
|
||||
before(function(done) {
|
||||
apf.config.setProperty("allow-select", false);
|
||||
apf.config.setProperty("allow-blur", false);
|
||||
tabs.getPanes()[0].focus();
|
||||
|
||||
|
||||
document.body.style.marginBottom = "33%";
|
||||
done();
|
||||
});
|
||||
|
||||
|
||||
describe("open", function() {
|
||||
var ace, tab;
|
||||
it('should open a pane with just an editor', function(done) {
|
||||
|
@ -157,63 +155,63 @@ require(["lib/architect/architect", "lib/chai/chai", "text!plugins/c9.ide.layout
|
|||
for (var i = 0; i < 100; i++) {
|
||||
str.push("a " + i + " b " + (i % 10));
|
||||
}
|
||||
|
||||
|
||||
tab.editor.focus();
|
||||
ace.setValue(str.join("\n"));
|
||||
|
||||
|
||||
ace.selection.setRange(new Range(0, 0, 0, 1));
|
||||
commands.exec("find");
|
||||
|
||||
|
||||
txtFind = findreplace.getElement("txtFind").ace;
|
||||
txtReplace = findreplace.getElement("txtReplace").ace;
|
||||
|
||||
|
||||
expect(txtFind.getValue()).equal("a");
|
||||
|
||||
|
||||
tab.editor.focus();
|
||||
ace.selection.setRange(new Range(0, 4, 0, 7));
|
||||
|
||||
|
||||
commands.exec("find");
|
||||
expect(txtFind.getValue()).equal("b 0");
|
||||
|
||||
ace.once("changeSelection", function() {
|
||||
|
||||
ace.once("changeSelection", function() {
|
||||
expect(ace.selection.getRange().end.row).equal(10);
|
||||
done();
|
||||
});
|
||||
setTimeout(function() {
|
||||
findreplace.findNext();
|
||||
findreplace.findNext();
|
||||
}, 100);
|
||||
});
|
||||
it('should find again and again', function() {
|
||||
commands.exec("findnext");
|
||||
expect(ace.selection.getRange().end.row).equal(20);
|
||||
|
||||
|
||||
ace.selection.setRange(new Range(0, 0, 0, 7));
|
||||
|
||||
|
||||
commands.exec("findnext");
|
||||
expect(ace.selection.getRange().start.column).equal(0);
|
||||
|
||||
|
||||
var kb = txtFind.keyBinding.$handlers[1].commands;
|
||||
var prev = kb["Shift-Return"];
|
||||
var next = kb["Return"];
|
||||
|
||||
|
||||
ace.selection.setRange(new Range(10, 5, 10, 5));
|
||||
txtFind.execCommand(next);
|
||||
expect(ace.selection.getRange()).to.deep.equal(new Range(10, 5, 10, 8));
|
||||
|
||||
|
||||
txtReplace.setValue("b 0");
|
||||
findreplace.replace();
|
||||
expect(ace.selection.getRange()).to.deep.equal(new Range(20, 5, 20, 8));
|
||||
findreplace.replace(true);
|
||||
expect(ace.selection.getRange()).to.deep.equal(new Range(10, 5, 10, 8));
|
||||
|
||||
|
||||
ace.selection.setRange(new Range(10, 8, 10, 8));
|
||||
txtFind.execCommand(prev);
|
||||
expect(ace.selection.getRange()).to.deep.equal(new Range(10, 5, 10, 8));
|
||||
|
||||
|
||||
ace.selection.setRange(new Range(10, 7, 10, 7));
|
||||
txtFind.execCommand(next);
|
||||
expect(ace.selection.getRange()).to.deep.equal(new Range(20, 5, 20, 8));
|
||||
|
||||
|
||||
ace.selection.setRange(new Range(20, 7, 20, 7));
|
||||
txtFind.execCommand(prev);
|
||||
expect(ace.selection.getRange()).to.deep.equal(new Range(10, 5, 10, 8));
|
||||
|
@ -248,7 +246,7 @@ require(["lib/architect/architect", "lib/chai/chai", "text!plugins/c9.ide.layout
|
|||
txtReplace.execCommand(prev);
|
||||
expect(txtReplace.getValue()).equal("baz");
|
||||
txtReplace.execCommand(prev);
|
||||
expect(txtReplace.getValue()).equal("bar");
|
||||
expect(txtReplace.getValue()).equal("bar");
|
||||
});
|
||||
it('should replace all in selection', function(done) {
|
||||
var range = new Range(5, 2, 7, 1);
|
||||
|
@ -276,17 +274,17 @@ require(["lib/architect/architect", "lib/chai/chai", "text!plugins/c9.ide.layout
|
|||
done();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
if (!onload.remain) {
|
||||
after(function(done) {
|
||||
tabs.unload();
|
||||
|
||||
|
||||
document.body.style.marginBottom = "";
|
||||
done();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
|
||||
register();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -25,7 +25,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
"plugins/c9.ide.ui/lib_apf",
|
||||
"plugins/c9.ide.ui/ui",
|
||||
"plugins/c9.core/settings",
|
||||
"plugins/c9.core/api.js",
|
||||
{
|
||||
packagePath: "plugins/c9.ide.find/find",
|
||||
basePath: baseProc
|
||||
|
@ -42,6 +41,7 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
"plugins/c9.vfs.client/vfs_client",
|
||||
"plugins/c9.vfs.client/endpoint",
|
||||
"plugins/c9.ide.auth/auth",
|
||||
"plugins/c9.core/api",
|
||||
"plugins/c9.fs/fs",
|
||||
"plugins/c9.fs/proc",
|
||||
|
||||
|
@ -117,7 +117,7 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
|
||||
it('should search for a token', function(done) {
|
||||
find.findFiles(options1, function(err, results, data) {
|
||||
Assert.equal(!err, true);
|
||||
if (err) throw err;
|
||||
expect(results).to.match(/Found 8 matches in 4 files/);
|
||||
var lines = results.split("\n");
|
||||
Assert.equal(lines.length, 16);
|
||||
|
@ -361,6 +361,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
});
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -54,7 +54,6 @@ require(["lib/architect/architect", "lib/chai/chai"],
|
|||
]
|
||||
}}}
|
||||
},
|
||||
"plugins/c9.core/api.js",
|
||||
{
|
||||
packagePath: "plugins/c9.ide.ui/ui",
|
||||
staticPrefix: "plugins/c9.ide.ui"
|
||||
|
@ -118,6 +117,7 @@ require(["lib/architect/architect", "lib/chai/chai"],
|
|||
"plugins/c9.vfs.client/vfs_client",
|
||||
"plugins/c9.vfs.client/endpoint",
|
||||
"plugins/c9.ide.auth/auth",
|
||||
"plugins/c9.core/api",
|
||||
"plugins/c9.ide.keys/commands",
|
||||
{
|
||||
packagePath: "plugins/c9.ide.run/run",
|
||||
|
@ -154,8 +154,6 @@ require(["lib/architect/architect", "lib/chai/chai"],
|
|||
|
||||
describe('immediate', function() {
|
||||
before(function(done) {
|
||||
apf.config.setProperty("allow-select", false);
|
||||
apf.config.setProperty("allow-blur", false);
|
||||
|
||||
window.bar.$ext.style.background = "rgba(220, 220, 220, 0.93)";
|
||||
window.bar.$ext.style.position = "fixed";
|
||||
|
@ -206,6 +204,6 @@ require(["lib/architect/architect", "lib/chai/chai"],
|
|||
// });
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -94,6 +94,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
});
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -3,296 +3,116 @@
|
|||
"use client";
|
||||
|
||||
|
||||
require(["lib/architect/architect", "lib/chai/chai", "plugins/c9.ide.language/complete_util", "assert"], function (architect, chai, util, complete) {
|
||||
var expect = chai.expect;
|
||||
var assert = require("assert");
|
||||
|
||||
util.setStaticPrefix("/static");
|
||||
|
||||
expect.setupArchitectTest(window.plugins = [
|
||||
{
|
||||
packagePath: "plugins/c9.core/c9",
|
||||
workspaceId: "ubuntu/ip-10-35-77-180",
|
||||
startdate: new Date(),
|
||||
debug: true,
|
||||
hosted: true,
|
||||
local: false,
|
||||
davPrefix: "/",
|
||||
staticPrefix: "/static"
|
||||
},
|
||||
|
||||
"plugins/c9.core/ext",
|
||||
"plugins/c9.core/http-xhr",
|
||||
"plugins/c9.core/util",
|
||||
"plugins/c9.ide.ui/lib_apf",
|
||||
{
|
||||
packagePath: "plugins/c9.core/settings",
|
||||
testing: true
|
||||
},
|
||||
"plugins/c9.core/api.js",
|
||||
{
|
||||
packagePath: "plugins/c9.ide.ui/ui",
|
||||
staticPrefix: "plugins/c9.ide.ui"
|
||||
},
|
||||
"plugins/c9.ide.editors/document",
|
||||
"plugins/c9.ide.editors/undomanager",
|
||||
{
|
||||
packagePath: "plugins/c9.ide.editors/editors",
|
||||
defaultEditor: "ace"
|
||||
},
|
||||
"plugins/c9.ide.editors/editor",
|
||||
"plugins/c9.ide.editors/tabmanager",
|
||||
"plugins/c9.ide.ui/focus",
|
||||
"plugins/c9.ide.editors/pane",
|
||||
"plugins/c9.ide.editors/tab",
|
||||
{
|
||||
packagePath: "plugins/c9.ide.ace/ace",
|
||||
staticPrefix: "plugins/c9.ide.layout.classic"
|
||||
},
|
||||
{
|
||||
packagePath: "plugins/c9.ide.language/language",
|
||||
workspaceDir: "/"
|
||||
},
|
||||
"plugins/c9.ide.language.core/keyhandler",
|
||||
"plugins/c9.ide.language/worker_util_helper",
|
||||
"plugins/c9.ide.language.core/complete",
|
||||
"plugins/c9.ide.language.core/tooltip",
|
||||
"plugins/c9.ide.language.core/marker",
|
||||
"plugins/c9.ide.language.generic/generic",
|
||||
"plugins/c9.ide.language.css/css",
|
||||
"plugins/c9.ide.language.javascript/javascript",
|
||||
"plugins/c9.ide.language.javascript.infer/jsinfer",
|
||||
{
|
||||
packagePath: "plugins/c9.ide.language.javascript.tern/tern",
|
||||
defs: [],
|
||||
plugins: [
|
||||
{
|
||||
name: "doc_comment",
|
||||
path: "tern/plugin/doc_comment",
|
||||
enabled: true,
|
||||
hidden: true,
|
||||
},
|
||||
{
|
||||
name: "node",
|
||||
path: "tern/plugin/node",
|
||||
enabled: true,
|
||||
hidden: false,
|
||||
},
|
||||
{
|
||||
name: "requirejs",
|
||||
path: "tern/plugin/requirejs",
|
||||
enabled: true,
|
||||
hidden: false,
|
||||
},
|
||||
{
|
||||
name: "architect_resolver",
|
||||
path: "./architect_resolver_worker",
|
||||
enabled: true,
|
||||
hidden: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
"plugins/c9.ide.language.javascript.tern/architect_resolver",
|
||||
"plugins/c9.ide.keys/commands",
|
||||
"plugins/c9.fs/proc",
|
||||
"plugins/c9.vfs.client/vfs_client",
|
||||
"plugins/c9.vfs.client/endpoint",
|
||||
"plugins/c9.ide.auth/auth",
|
||||
"plugins/c9.fs/fs",
|
||||
"plugins/c9.ide.ui/menus",
|
||||
{
|
||||
packagePath: "plugins/c9.ide.immediate/immediate",
|
||||
staticPrefix: "plugins/c9.ide.layout.classic"
|
||||
},
|
||||
"plugins/c9.ide.language.javascript.immediate/immediate",
|
||||
"plugins/c9.ide.immediate/evaluator",
|
||||
"plugins/c9.ide.immediate/evaluators/browserjs",
|
||||
"plugins/c9.ide.console/console",
|
||||
"plugins/c9.ide.ace.statusbar/statusbar",
|
||||
"plugins/c9.ide.ace.gotoline/gotoline",
|
||||
|
||||
{
|
||||
consumes: [
|
||||
"tabManager",
|
||||
"ace",
|
||||
"Document",
|
||||
"language.keyhandler",
|
||||
"language.complete",
|
||||
"language"
|
||||
],
|
||||
provides: [],
|
||||
setup: main
|
||||
}
|
||||
], architect);
|
||||
|
||||
function main(options, imports, register) {
|
||||
require(["plugins/c9.ide.language/test_base"], function(base) {
|
||||
base.setup(function(err, imports, helpers) {
|
||||
var tabs = imports.tabManager;
|
||||
var ace = imports.ace;
|
||||
var Document = imports.Document;
|
||||
var language = imports.language;
|
||||
var complete = imports["language.complete"];
|
||||
|
||||
util.setStaticPrefix("/static");
|
||||
complete.$setShowDocDelay(50);
|
||||
var chai = require("lib/chai/chai");
|
||||
var expect = chai.expect;
|
||||
var assert = require("assert");
|
||||
|
||||
var timer;
|
||||
after(function() { clearTimeout(timer); });
|
||||
|
||||
function getTabHtml(tab) {
|
||||
return tab.pane.aml.getPage("editor::" + tab.editorType).$ext;
|
||||
}
|
||||
|
||||
function afterCompleteOpen(callback, delay) {
|
||||
clearTimeout(timer);
|
||||
timer = setTimeout(function() {
|
||||
var el = document.getElementsByClassName("ace_autocomplete")[0];
|
||||
if (!el || el.style.display === "none")
|
||||
return afterCompleteOpen(callback, 100);
|
||||
timer = setTimeout(function() {
|
||||
callback(el);
|
||||
}, 5);
|
||||
}, delay || 5);
|
||||
}
|
||||
|
||||
function afterCompleteDocOpen(callback, delay) {
|
||||
timer = setTimeout(function() {
|
||||
var el = document.getElementsByClassName("code_complete_doc_text")[0];
|
||||
if (!el || el.style.display === "none")
|
||||
return afterCompleteDocOpen(callback);
|
||||
timer = setTimeout(function() {
|
||||
callback(el);
|
||||
}, 5);
|
||||
}, delay || 5);
|
||||
}
|
||||
|
||||
function isCompleterOpen() {
|
||||
var el = document.getElementsByClassName("ace_autocomplete")[0];
|
||||
return el && el.style.display === "none";
|
||||
}
|
||||
|
||||
expect.html.setConstructor(function(tab) {
|
||||
if (typeof tab == "object")
|
||||
return getTabHtml(tab);
|
||||
});
|
||||
|
||||
describe('ace', function() {
|
||||
this.timeout(20000);
|
||||
describe("architect_resolver", function() {
|
||||
var jsTab;
|
||||
var jsSession;
|
||||
|
||||
// Setup
|
||||
beforeEach(setup);
|
||||
|
||||
before(function(done) {
|
||||
window.bar.$ext.style.background = "rgba(220, 220, 220, 0.93)";
|
||||
window.bar.$ext.style.position = "fixed";
|
||||
window.bar.$ext.style.left = "20px";
|
||||
window.bar.$ext.style.right = "20px";
|
||||
window.bar.$ext.style.bottom = "20px";
|
||||
window.bar.$ext.style.height = "33%";
|
||||
|
||||
document.body.style.marginBottom = "33%";
|
||||
|
||||
tabs.once("ready", function() {
|
||||
tabs.getPanes()[0].focus();
|
||||
setup(function() {
|
||||
// Trigger intialization
|
||||
jsTab.editor.ace.onTextInput("m");
|
||||
helpers.afterCompleteOpen(function(el) {
|
||||
setup(done);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function setup(done) {
|
||||
tabs.getTabs().forEach(function(tab) {
|
||||
tab.close(true);
|
||||
});
|
||||
// tab.close() isn't quite synchronous, wait for it :(
|
||||
complete.closeCompletionBox();
|
||||
setTimeout(function() {
|
||||
tabs.openFile("/plugins/c9.dummy/architect_test_dummy.js", function(err, tab) {
|
||||
jsTab = tab;
|
||||
jsSession = jsTab.document.getSession().session;
|
||||
expect(jsSession).to.not.equal(null);
|
||||
setTimeout(function() {
|
||||
complete.closeCompletionBox();
|
||||
jsTab.editor.ace.selection.setSelectionRange({ start: { row: 15, column: 17 }, end: { row: 15, column: 17 }});
|
||||
jsTab.editor.ace.renderer.scrollCursorIntoView();
|
||||
done();
|
||||
});
|
||||
});
|
||||
}, 100);
|
||||
}
|
||||
|
||||
it('shows an inference completer popup for a local architect module', function(done) {
|
||||
jsTab.editor.ace.onTextInput("my");
|
||||
helpers.afterCompleteOpen(function(el) {
|
||||
expect.html(el).text(/myplugin/);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
describe("architect_resolver", function() {
|
||||
var jsTab;
|
||||
var jsSession;
|
||||
|
||||
// Setup
|
||||
beforeEach(setup);
|
||||
|
||||
before(function(done) {
|
||||
setup(function() {
|
||||
// Trigger intialization
|
||||
jsTab.editor.ace.onTextInput("m");
|
||||
afterCompleteOpen(function(el) {
|
||||
setup(done);
|
||||
});
|
||||
});
|
||||
it('shows a completer popup for a non-local architect module', function(done) {
|
||||
jsTab.editor.ace.onTextInput("P");
|
||||
helpers.afterCompleteOpen(function(el) {
|
||||
expect.html(el).text(/Plugin/);
|
||||
done();
|
||||
});
|
||||
|
||||
function setup(done) {
|
||||
tabs.getTabs().forEach(function(tab) {
|
||||
tab.close(true);
|
||||
});
|
||||
// tab.close() isn't quite synchronous, wait for it :(
|
||||
complete.closeCompletionBox();
|
||||
setTimeout(function() {
|
||||
tabs.openFile("/plugins/c9.dummy/architect_test_dummy.js", function(err, tab) {
|
||||
jsTab = tab;
|
||||
jsSession = jsTab.document.getSession().session;
|
||||
expect(jsSession).to.not.equal(null);
|
||||
setTimeout(function() {
|
||||
complete.closeCompletionBox();
|
||||
jsTab.editor.ace.selection.setSelectionRange({ start: { row: 15, column: 17 }, end: { row: 15, column: 17 }});
|
||||
done();
|
||||
});
|
||||
});
|
||||
}, 500);
|
||||
}
|
||||
|
||||
it('shows an inference completer popup for a local architect module', function(done) {
|
||||
jsTab.editor.ace.onTextInput("my");
|
||||
afterCompleteOpen(function(el) {
|
||||
expect.html(el).text(/myplugin/);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('shows a documentation popup for non-local architect functions', function(done) {
|
||||
jsTab.editor.ace.onTextInput("Plugin");
|
||||
jsTab.editor.ace.onTextInput(".");
|
||||
helpers.afterCompleteDocOpen(function(el) {
|
||||
expect.html(el).text(/so bogus/);
|
||||
done();
|
||||
});
|
||||
|
||||
it('shows an completer popup for a non-local architect module', function(done) {
|
||||
jsTab.editor.ace.onTextInput("P");
|
||||
afterCompleteOpen(function(el) {
|
||||
expect.html(el).text(/Plugin/);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('shows a completion indirect import references', function(done) {
|
||||
jsTab.editor.ace.onTextInput("Plugin;\nPlugin");
|
||||
jsTab.editor.ace.onTextInput(".");
|
||||
helpers.afterCompleteDocOpen(function(el) {
|
||||
expect.html(el).text(/so bogus/);
|
||||
done();
|
||||
});
|
||||
|
||||
it('shows a documentation popup for non-local architect functions', function(done) {
|
||||
jsTab.editor.ace.onTextInput("Plugin");
|
||||
jsTab.editor.ace.onTextInput(".");
|
||||
afterCompleteDocOpen(function(el) {
|
||||
expect.html(el).text(/so bogus/);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('shows types for a non-local architect function', function(done) {
|
||||
jsTab.editor.ace.onTextInput("Plugin");
|
||||
jsTab.editor.ace.onTextInput(".");
|
||||
helpers.afterCompleteDocOpen(function(el) {
|
||||
expect.html(el).text(/s : string/);
|
||||
done();
|
||||
});
|
||||
|
||||
it('shows a completion indirect import references', function(done) {
|
||||
jsTab.editor.ace.onTextInput("Plugin;\nPlugin");
|
||||
jsTab.editor.ace.onTextInput(".");
|
||||
afterCompleteDocOpen(function(el) {
|
||||
expect.html(el).text(/so bogus/);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('shows a documentation popup for modules', function(done) {
|
||||
jsTab.editor.ace.onTextInput("Pl");
|
||||
helpers.afterCompleteDocOpen(function(el) {
|
||||
expect.html(el).text(/dummy[\s\S]*documentation/);
|
||||
assert(!el.textContent.match(/\*/));
|
||||
done();
|
||||
});
|
||||
|
||||
it('shows types for a non-local architect function', function(done) {
|
||||
jsTab.editor.ace.onTextInput("Plugin");
|
||||
jsTab.editor.ace.onTextInput(".");
|
||||
afterCompleteDocOpen(function(el) {
|
||||
expect.html(el).text(/s : string/);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('shows a documentation popup for modules', function(done) {
|
||||
jsTab.editor.ace.onTextInput("Pl");
|
||||
afterCompleteDocOpen(function(el) {
|
||||
expect.html(el).text(/dummy[\s\S]*documentation/);
|
||||
assert(!el.textContent.match(/\*/));
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('shows module name completions for imports', function(done) {
|
||||
jsTab.editor.ace.onTextInput('main.consumes = ["u');
|
||||
afterCompleteOpen(function(el) {
|
||||
expect.html(el).text(/ui/);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('shows module name completions for imports', function(done) {
|
||||
jsTab.editor.ace.onTextInput('main.consumes = ["u');
|
||||
helpers.afterCompleteOpen(function(el) {
|
||||
expect.html(el).text(/ui/);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
@ -2,290 +2,131 @@
|
|||
|
||||
"use client";
|
||||
|
||||
require(["lib/architect/architect", "lib/chai/chai", "plugins/c9.ide.language/complete_util", "ace/test/assertions"], function (architect, chai, util, complete) {
|
||||
var expect = chai.expect;
|
||||
var assert = require("ace/test/assertions");
|
||||
|
||||
util.setStaticPrefix("/static");
|
||||
|
||||
expect.setupArchitectTest([
|
||||
{
|
||||
packagePath: "plugins/c9.core/c9",
|
||||
workspaceId: "ubuntu/ip-10-35-77-180",
|
||||
startdate: new Date(),
|
||||
debug: true,
|
||||
hosted: true,
|
||||
local: false,
|
||||
davPrefix: "/",
|
||||
staticPrefix: "/static"
|
||||
},
|
||||
|
||||
"plugins/c9.core/ext",
|
||||
"plugins/c9.core/http-xhr",
|
||||
"plugins/c9.core/util",
|
||||
"plugins/c9.ide.ui/lib_apf",
|
||||
{
|
||||
packagePath: "plugins/c9.core/settings",
|
||||
testing: true
|
||||
},
|
||||
"plugins/c9.core/api.js",
|
||||
{
|
||||
packagePath: "plugins/c9.ide.ui/ui",
|
||||
staticPrefix: "plugins/c9.ide.ui"
|
||||
},
|
||||
"plugins/c9.ide.editors/document",
|
||||
"plugins/c9.ide.editors/undomanager",
|
||||
{
|
||||
packagePath: "plugins/c9.ide.editors/editors",
|
||||
defaultEditor: "ace"
|
||||
},
|
||||
"plugins/c9.ide.editors/editor",
|
||||
"plugins/c9.ide.editors/tabmanager",
|
||||
"plugins/c9.ide.ui/focus",
|
||||
"plugins/c9.ide.editors/pane",
|
||||
"plugins/c9.ide.editors/tab",
|
||||
{
|
||||
packagePath: "plugins/c9.ide.ace/ace",
|
||||
staticPrefix: "plugins/c9.ide.layout.classic"
|
||||
},
|
||||
{
|
||||
packagePath: "plugins/c9.ide.language/language",
|
||||
workspaceDir: "/"
|
||||
},
|
||||
"plugins/c9.ide.language/worker_util_helper",
|
||||
"plugins/c9.ide.language.core/keyhandler",
|
||||
"plugins/c9.ide.language.core/complete",
|
||||
"plugins/c9.ide.language.core/tooltip",
|
||||
"plugins/c9.ide.language.core/marker",
|
||||
"plugins/c9.ide.language.generic/generic",
|
||||
"plugins/c9.ide.language.css/css",
|
||||
"plugins/c9.ide.language.javascript/javascript",
|
||||
"plugins/c9.ide.language.javascript.infer/jsinfer",
|
||||
"plugins/c9.ide.keys/commands",
|
||||
"plugins/c9.fs/proc",
|
||||
"plugins/c9.vfs.client/vfs_client",
|
||||
"plugins/c9.vfs.client/endpoint",
|
||||
"plugins/c9.ide.auth/auth",
|
||||
"plugins/c9.fs/fs",
|
||||
"plugins/c9.ide.ui/menus",
|
||||
{
|
||||
packagePath: "plugins/c9.ide.immediate/immediate",
|
||||
staticPrefix: "plugins/c9.ide.layout.classic"
|
||||
},
|
||||
"plugins/c9.ide.language.javascript.immediate/immediate",
|
||||
"plugins/c9.ide.immediate/evaluator",
|
||||
"plugins/c9.ide.immediate/evaluators/browserjs",
|
||||
"plugins/c9.ide.console/console",
|
||||
"plugins/c9.ide.ace.statusbar/statusbar",
|
||||
"plugins/c9.ide.ace.gotoline/gotoline",
|
||||
"plugins/c9.ide.save/save",
|
||||
{
|
||||
packagePath: "plugins/c9.ide.language.jsonalyzer/jsonalyzer",
|
||||
bashBin: "bash",
|
||||
useCollab: false,
|
||||
useSend: true,
|
||||
homeDir: "~",
|
||||
workspaceDir: "/fake_root/",
|
||||
},
|
||||
"plugins/c9.ide.language.jsonalyzer/mock_collab",
|
||||
// "plugins/c9.ide.language.jsonalyzer/architect_resolver",
|
||||
|
||||
{
|
||||
consumes: [
|
||||
"tabManager",
|
||||
"ace",
|
||||
"Document",
|
||||
"language.keyhandler",
|
||||
"language.complete",
|
||||
"language"
|
||||
],
|
||||
provides: [],
|
||||
setup: main
|
||||
}
|
||||
], architect);
|
||||
|
||||
function main(options, imports, register) {
|
||||
require(["plugins/c9.ide.language/test_base"], function(base) {
|
||||
base.setup(function(err, imports, helpers) {
|
||||
var tabs = imports.tabManager;
|
||||
var ace = imports.ace;
|
||||
var Document = imports.Document;
|
||||
var language = imports.language;
|
||||
var complete = imports["language.complete"];
|
||||
|
||||
util.setStaticPrefix("/static");
|
||||
complete.$setShowDocDelay(50);
|
||||
var chai = require("lib/chai/chai");
|
||||
var expect = chai.expect;
|
||||
var assert = require("assert");
|
||||
|
||||
function getTabHtml(tab) {
|
||||
return tab.pane.aml.getPage("editor::" + tab.editorType).$ext;
|
||||
}
|
||||
|
||||
function afterCompleteOpen(callback) {
|
||||
setTimeout(function() {
|
||||
var el = document.getElementsByClassName("ace_autocomplete")[0];
|
||||
if (!el || el.style.display === "none")
|
||||
return setTimeout(function() {
|
||||
afterCompleteOpen(callback);
|
||||
}, 1000);
|
||||
setTimeout(function() {
|
||||
callback(el);
|
||||
}, 50);
|
||||
}, 50);
|
||||
}
|
||||
|
||||
function afterCompleteDocOpen(callback) {
|
||||
setTimeout(function() {
|
||||
var el = document.getElementsByClassName("code_complete_doc_text")[0];
|
||||
if (!el || el.style.display === "none")
|
||||
return afterCompleteDocOpen(callback);
|
||||
setTimeout(function() {
|
||||
callback(el);
|
||||
}, 50);
|
||||
}, 50);
|
||||
}
|
||||
|
||||
function isCompleterOpen() {
|
||||
var el = document.getElementsByClassName("ace_autocomplete")[0];
|
||||
return el && el.style.display === "none";
|
||||
}
|
||||
|
||||
expect.html.setConstructor(function(tab) {
|
||||
if (typeof tab == "object")
|
||||
return getTabHtml(tab);
|
||||
});
|
||||
|
||||
describe('ace', function() {
|
||||
this.timeout(30000);
|
||||
describe("analysis", function() {
|
||||
var tab;
|
||||
var session;
|
||||
var worker;
|
||||
|
||||
before(function(done) {
|
||||
window.bar.$ext.style.background = "rgba(220, 220, 220, 0.93)";
|
||||
window.bar.$ext.style.position = "fixed";
|
||||
window.bar.$ext.style.left = "20px";
|
||||
window.bar.$ext.style.right = "20px";
|
||||
window.bar.$ext.style.bottom = "20px";
|
||||
window.bar.$ext.style.height = "33%";
|
||||
|
||||
document.body.style.marginBottom = "33%";
|
||||
|
||||
tabs.on("ready", function() {
|
||||
tabs.getPanes()[0].focus();
|
||||
language.getWorker(function(err, result) {
|
||||
worker = result;
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
describe("analysis", function() {
|
||||
var tab;
|
||||
var session;
|
||||
var worker;
|
||||
|
||||
before(function(done) {
|
||||
language.getWorker(function(err, result) {
|
||||
worker = result;
|
||||
done();
|
||||
});
|
||||
// Setup
|
||||
beforeEach(function(done) {
|
||||
tabs.getTabs().forEach(function(tab) {
|
||||
tab.close(true);
|
||||
});
|
||||
|
||||
// Setup
|
||||
beforeEach(function(done) {
|
||||
tabs.getTabs().forEach(function(tab) {
|
||||
tab.close(true);
|
||||
});
|
||||
// tab.close() isn't quite synchronous, wait for it :(
|
||||
complete.closeCompletionBox();
|
||||
setTimeout(function() {
|
||||
tabs.openFile("/test_broken.sh", function(err, _tab) {
|
||||
if (err) return done(err);
|
||||
tab = _tab;
|
||||
session = tab.document.getSession().session;
|
||||
expect(session).to.not.equal(null);
|
||||
setTimeout(function() {
|
||||
complete.closeCompletionBox();
|
||||
done();
|
||||
});
|
||||
// tab.close() isn't quite synchronous, wait for it :(
|
||||
complete.closeCompletionBox();
|
||||
setTimeout(function() {
|
||||
tabs.openFile("/test_broken.sh", function(err, _tab) {
|
||||
if (err) return done(err);
|
||||
tab = _tab;
|
||||
session = tab.document.getSession().session;
|
||||
expect(session).to.not.equal(null);
|
||||
setTimeout(function() {
|
||||
complete.closeCompletionBox();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it("shows syntax error markers for shell scripts", function beginTest(done) {
|
||||
// Wait for analysis to complete
|
||||
if (!session.getAnnotations().length)
|
||||
return session.once("changeAnnotation", beginTest.bind(null, done));
|
||||
});
|
||||
|
||||
it("shows syntax error markers for shell scripts", function beginTest(done) {
|
||||
// Wait for analysis to complete
|
||||
if (!session.getAnnotations().length)
|
||||
return session.once("changeAnnotation", beginTest.bind(null, done));
|
||||
|
||||
expect(session.getAnnotations()).to.have.length(1);
|
||||
done();
|
||||
});
|
||||
|
||||
it("shows syntax error markers for php scripts", function(done) {
|
||||
tabs.openFile("/test_broken.php", function(err, _tab) {
|
||||
tab = _tab;
|
||||
tabs.focusTab(tab);
|
||||
session = tab.document.getSession().session;
|
||||
|
||||
session.on("changeAnnotation", testAnnos);
|
||||
testAnnos();
|
||||
|
||||
function testAnnos() {
|
||||
if (!session.getAnnotations().length)
|
||||
return;
|
||||
session.off("changeAnnotation", testAnnos);
|
||||
done();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
it("shows syntax error markers for go scripts", function(done) {
|
||||
tabs.openFile("/test_broken.go", function(err, _tab) {
|
||||
tab = _tab;
|
||||
tabs.focusTab(tab);
|
||||
session = tab.document.getSession().session;
|
||||
|
||||
session.on("changeAnnotation", testAnnos);
|
||||
testAnnos();
|
||||
|
||||
function testAnnos() {
|
||||
if (!session.getAnnotations().length)
|
||||
return;
|
||||
session.off("changeAnnotation", testAnnos);
|
||||
done();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
it("shows syntax error markers for ruby scripts", function(done) {
|
||||
tabs.openFile("/test_broken.rb", function(err, _tab) {
|
||||
tab = _tab;
|
||||
tabs.focusTab(tab);
|
||||
session = tab.document.getSession().session;
|
||||
|
||||
session.on("changeAnnotation", testAnnos);
|
||||
testAnnos();
|
||||
|
||||
function testAnnos() {
|
||||
if (!session.getAnnotations().length)
|
||||
return;
|
||||
session.off("changeAnnotation", testAnnos);
|
||||
done();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
it('does completion without going to the server', function beginTest(done) {
|
||||
// Wait for analysis to complete
|
||||
if (!session.getAnnotations().length)
|
||||
return session.once("changeAnnotation", beginTest.bind(null, done));
|
||||
|
||||
var callServer;
|
||||
worker.on("jsonalyzerCallServer", callServer = function() {
|
||||
assert(false, "Server should not be called");
|
||||
});
|
||||
afterCompleteOpen(function(el) {
|
||||
expect.html(el).text(/foo/);
|
||||
worker.off("jsonalyzerCallServer", callServer);
|
||||
expect(session.getAnnotations()).to.have.length(1);
|
||||
done();
|
||||
});
|
||||
|
||||
it.skip("shows syntax error markers for php scripts", function(done) {
|
||||
tabs.openFile("/test_broken.php", function(err, _tab) {
|
||||
tab = _tab;
|
||||
tabs.focusTab(tab);
|
||||
session = tab.document.getSession().session;
|
||||
|
||||
session.on("changeAnnotation", testAnnos);
|
||||
testAnnos();
|
||||
|
||||
function testAnnos() {
|
||||
if (!session.getAnnotations().length)
|
||||
return;
|
||||
session.off("changeAnnotation", testAnnos);
|
||||
done();
|
||||
});
|
||||
tab.editor.ace.selection.setSelectionRange({ start: { row: 1, column: 1 }, end: { row: 1, column: 1 }});
|
||||
complete.deferredInvoke(false, tab.editor.ace);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
it.skip("shows syntax error markers for go scripts", function(done) {
|
||||
tabs.openFile("/test_broken.go", function(err, _tab) {
|
||||
tab = _tab;
|
||||
tabs.focusTab(tab);
|
||||
session = tab.document.getSession().session;
|
||||
|
||||
session.on("changeAnnotation", testAnnos);
|
||||
testAnnos();
|
||||
|
||||
function testAnnos() {
|
||||
if (!session.getAnnotations().length)
|
||||
return;
|
||||
session.off("changeAnnotation", testAnnos);
|
||||
done();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
it.skip("shows syntax error markers for ruby scripts", function(done) {
|
||||
tabs.openFile("/test_broken.rb", function(err, _tab) {
|
||||
tab = _tab;
|
||||
tabs.focusTab(tab);
|
||||
session = tab.document.getSession().session;
|
||||
|
||||
session.on("changeAnnotation", testAnnos);
|
||||
testAnnos();
|
||||
|
||||
function testAnnos() {
|
||||
if (!session.getAnnotations().length)
|
||||
return;
|
||||
session.off("changeAnnotation", testAnnos);
|
||||
done();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
it('does completion without going to the server', function beginTest(done) {
|
||||
// Wait for analysis to complete
|
||||
if (!session.getAnnotations().length)
|
||||
return session.once("changeAnnotation", beginTest.bind(null, done));
|
||||
|
||||
var callServer;
|
||||
worker.on("jsonalyzerCallServer", callServer = function() {
|
||||
assert(false, "Server should not be called");
|
||||
});
|
||||
helpers.afterCompleteOpen(function(el) {
|
||||
expect.html(el).text(/foo/);
|
||||
worker.off("jsonalyzerCallServer", callServer);
|
||||
done();
|
||||
});
|
||||
tab.editor.ace.selection.setSelectionRange({ start: { row: 1, column: 1 }, end: { row: 1, column: 1 }});
|
||||
complete.deferredInvoke(false, tab.editor.ace);
|
||||
});
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -14,7 +14,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
settings: "default",
|
||||
testing: true
|
||||
},
|
||||
"plugins/c9.core/api.js",
|
||||
"plugins/c9.ide.ui/lib_apf",
|
||||
"plugins/c9.ide.ui/anims",
|
||||
{
|
||||
|
@ -420,6 +419,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
}
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -32,7 +32,6 @@ require([
|
|||
packagePath: "plugins/c9.core/settings",
|
||||
testing: true
|
||||
},
|
||||
"plugins/c9.core/api.js",
|
||||
"plugins/c9.ide.keys/commands",
|
||||
"plugins/c9.ide.keys/editor",
|
||||
{
|
||||
|
@ -63,6 +62,7 @@ require([
|
|||
"plugins/c9.vfs.client/vfs_client",
|
||||
"plugins/c9.vfs.client/endpoint",
|
||||
"plugins/c9.ide.auth/auth",
|
||||
"plugins/c9.core/api",
|
||||
|
||||
{
|
||||
consumes: ["Plugin", "tabManager", "preferences", "settings", "ui", "util", "commands", "preferences.general"],
|
||||
|
@ -89,6 +89,7 @@ require([
|
|||
this.timeout(20000);
|
||||
|
||||
before(function(done) {
|
||||
|
||||
bar.$ext.style.height = "66%";
|
||||
|
||||
document.body.style.marginBottom = "66%";
|
||||
|
@ -187,6 +188,6 @@ require([
|
|||
}
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -44,7 +44,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
}}}
|
||||
}
|
||||
},
|
||||
"plugins/c9.core/api.js",
|
||||
{
|
||||
packagePath: "plugins/c9.ide.ui/ui",
|
||||
staticPrefix: "plugins/c9.ide.ui"
|
||||
|
@ -74,6 +73,7 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
},
|
||||
"plugins/c9.vfs.client/endpoint",
|
||||
"plugins/c9.ide.auth/auth",
|
||||
"plugins/c9.core/api",
|
||||
{
|
||||
packagePath: "plugins/c9.ide.run/run",
|
||||
staticPrefix: "plugins/c9.ide.run",
|
||||
|
@ -187,8 +187,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
|
||||
describe('build', function() {
|
||||
before(function(done) {
|
||||
apf.config.setProperty("allow-select", false);
|
||||
apf.config.setProperty("allow-blur", false);
|
||||
|
||||
bar.$ext.style.background = "rgba(220, 220, 220, 0.93)";
|
||||
bar.$ext.style.position = "fixed";
|
||||
|
@ -366,6 +364,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
}
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -42,7 +42,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
]
|
||||
}}}
|
||||
},
|
||||
"plugins/c9.core/api.js",
|
||||
{
|
||||
packagePath: "plugins/c9.ide.ui/ui",
|
||||
staticPrefix: "plugins/c9.ide.ui"
|
||||
|
@ -66,6 +65,7 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
"plugins/c9.vfs.client/vfs_client",
|
||||
"plugins/c9.vfs.client/endpoint",
|
||||
"plugins/c9.ide.auth/auth",
|
||||
"plugins/c9.core/api",
|
||||
{
|
||||
packagePath: "plugins/c9.ide.run/run",
|
||||
testing: true,
|
||||
|
@ -165,8 +165,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
|
||||
describe('build gui', function() {
|
||||
before(function(done) {
|
||||
apf.config.setProperty("allow-select", false);
|
||||
apf.config.setProperty("allow-blur", false);
|
||||
|
||||
bar.$ext.style.background = "rgba(220, 220, 220, 0.93)";
|
||||
bar.$ext.style.position = "fixed";
|
||||
|
@ -232,6 +230,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
}
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -43,6 +43,7 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
"plugins/c9.vfs.client/vfs_client",
|
||||
"plugins/c9.vfs.client/endpoint",
|
||||
"plugins/c9.ide.auth/auth",
|
||||
"plugins/c9.core/api",
|
||||
"plugins/c9.ide.run.debug/breakpoints",
|
||||
{
|
||||
packagePath: "plugins/c9.ide.panels/panels",
|
||||
|
@ -217,6 +218,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
});
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -1,4 +1,4 @@
|
|||
/*global describe it before */
|
||||
/*global describe it before bar */
|
||||
|
||||
"use client";
|
||||
|
||||
|
@ -32,10 +32,12 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
"plugins/c9.vfs.client/vfs_client",
|
||||
"plugins/c9.vfs.client/endpoint",
|
||||
"plugins/c9.ide.auth/auth",
|
||||
"plugins/c9.core/api",
|
||||
"plugins/c9.ide.run.debug/callstack",
|
||||
"plugins/c9.ide.run.debug/debugpanel",
|
||||
|
||||
{
|
||||
consumes: ["callstack"],
|
||||
consumes: ["callstack", "layout"],
|
||||
provides: [],
|
||||
setup: main
|
||||
}
|
||||
|
@ -43,19 +45,13 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
|
||||
function main(options, imports, register) {
|
||||
var callstack = imports.callstack;
|
||||
callstack.show();
|
||||
var datagrid = callstack.getElement("datagrid");
|
||||
var layout = imports.layout;
|
||||
var datagrid;
|
||||
|
||||
function countEvents(count, expected, done) {
|
||||
if (count == expected)
|
||||
done();
|
||||
else
|
||||
throw new Error("Wrong Event Count: "
|
||||
+ count + " of " + expected);
|
||||
}
|
||||
|
||||
describe('breakpoints', function() {
|
||||
describe('callstack', function() {
|
||||
before(function(done) {
|
||||
var bar = layout.findParent()
|
||||
|
||||
bar.$ext.style.background = "rgba(220, 220, 220, 0.93)";
|
||||
bar.$ext.style.position = "fixed";
|
||||
bar.$ext.style.top = "75px";
|
||||
|
@ -65,6 +61,9 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
bar.$ext.style.width = "300px";
|
||||
bar.$ext.style.height = "";
|
||||
|
||||
callstack.show({ html: bar.$ext});
|
||||
datagrid = callstack.getElement("datagrid");
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
|
@ -89,6 +88,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
});
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -86,6 +86,7 @@ require([
|
|||
"plugins/c9.vfs.client/vfs_client",
|
||||
"plugins/c9.vfs.client/endpoint",
|
||||
"plugins/c9.ide.auth/auth",
|
||||
"plugins/c9.core/api",
|
||||
{
|
||||
packagePath: "plugins/c9.ide.run/run",
|
||||
testing: true,
|
||||
|
@ -118,13 +119,12 @@ require([
|
|||
},
|
||||
"plugins/c9.ide.run.debug/debuggers/v8/v8debugger",
|
||||
"plugins/c9.ide.run.debug/breakpoints",
|
||||
"plugins/c9.ide.run.debug/buttons",
|
||||
"plugins/c9.ide.run.debug/callstack",
|
||||
"plugins/c9.ide.run.debug/immediate",
|
||||
"plugins/c9.ide.run.debug/variables",
|
||||
"plugins/c9.ide.run.debug/watches",
|
||||
//"plugins/c9.ide.run.debug/quickwatch",
|
||||
|
||||
"plugins/c9.ide.run.debug/debuggers/socket",
|
||||
"plugins/c9.ide.run.debug/debugpanel",
|
||||
{
|
||||
consumes: ["run", "debugger", "fs", "tabManager", "sourcemap", "v8debugger"],
|
||||
provides: [],
|
||||
|
@ -154,8 +154,6 @@ require([
|
|||
|
||||
describe('debug', function() {
|
||||
before(function(done) {
|
||||
apf.config.setProperty("allow-select", false);
|
||||
apf.config.setProperty("allow-blur", false);
|
||||
|
||||
document.body.style.marginBottom = "200px";
|
||||
done();
|
||||
|
@ -424,6 +422,6 @@ require([
|
|||
// });
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -1,4 +1,4 @@
|
|||
/*global describe it before */
|
||||
/*global describe it before bar */
|
||||
|
||||
"use client";
|
||||
|
||||
|
@ -32,7 +32,10 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
"plugins/c9.vfs.client/vfs_client",
|
||||
"plugins/c9.vfs.client/endpoint",
|
||||
"plugins/c9.ide.auth/auth",
|
||||
"plugins/c9.core/api",
|
||||
"plugins/c9.ide.run.debug/variables",
|
||||
"plugins/c9.ide.run.debug/debugpanel",
|
||||
"plugins/c9.ide.run.debug/callstack",
|
||||
|
||||
{
|
||||
consumes: ["variables"],
|
||||
|
@ -43,8 +46,7 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
|
||||
function main(options, imports, register) {
|
||||
var variables = imports.variables;
|
||||
variables.show();
|
||||
var datagrid = variables.getElement("datagrid");
|
||||
var datagrid;
|
||||
|
||||
function countEvents(count, expected, done) {
|
||||
if (count == expected)
|
||||
|
@ -56,6 +58,8 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
|
||||
describe('breakpoints', function() {
|
||||
before(function(done) {
|
||||
var datagrid = variables.getElement("datagrid");
|
||||
|
||||
bar.$ext.style.background = "rgba(220, 220, 220, 0.93)";
|
||||
bar.$ext.style.position = "fixed";
|
||||
bar.$ext.style.top = "75px";
|
||||
|
@ -65,6 +69,10 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
bar.$ext.style.width = "300px";
|
||||
bar.$ext.style.height = "";
|
||||
|
||||
variables.show({
|
||||
html: bar.$ext
|
||||
});
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
|
@ -89,6 +97,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
});
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -1,4 +1,4 @@
|
|||
/*global describe it before */
|
||||
/*global describe it before bar */
|
||||
|
||||
"use client";
|
||||
|
||||
|
@ -49,6 +49,7 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root", "events"],
|
|||
"plugins/c9.vfs.client/vfs_client",
|
||||
"plugins/c9.vfs.client/endpoint",
|
||||
"plugins/c9.ide.auth/auth",
|
||||
"plugins/c9.core/api",
|
||||
"plugins/c9.ide.ui/menus",
|
||||
"plugins/c9.ide.panels/panels",
|
||||
"plugins/c9.ide.panels/panel",
|
||||
|
@ -61,7 +62,7 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root", "events"],
|
|||
"plugins/c9.ide.run.debug/breakpoints",
|
||||
"plugins/c9.ide.run.debug/watches",
|
||||
{
|
||||
consumes: ["panels", "debugger", "watches", "breakpoints"],
|
||||
consumes: ["panels", "debugger", "watches", "breakpoints", "layout"],
|
||||
provides: [],
|
||||
setup: main
|
||||
}
|
||||
|
@ -72,19 +73,9 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root", "events"],
|
|||
var panels = imports.panels;
|
||||
var breakpoints = imports.breakpoints;
|
||||
var debug = imports.debugger;
|
||||
|
||||
panels.activate("debugger");
|
||||
// watches.show();
|
||||
var datagrid = watches.getElement("datagrid");
|
||||
var layout = imports.layout;
|
||||
var datagrid;
|
||||
|
||||
function countEvents(count, expected, done) {
|
||||
if (count == expected)
|
||||
done();
|
||||
else
|
||||
throw new Error("Wrong Event Count: "
|
||||
+ count + " of " + expected);
|
||||
}
|
||||
|
||||
var testDebugger = new EventEmitter();
|
||||
testDebugger.attach = function () {
|
||||
testDebugger.emit("attached", { breakpoints: breakpoints });
|
||||
|
@ -92,6 +83,10 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root", "events"],
|
|||
|
||||
describe('breakpoints', function() {
|
||||
before(function(done) {
|
||||
layout.findParent();
|
||||
panels.activate("debugger");
|
||||
var datagrid = watches.getElement("datagrid");
|
||||
|
||||
bar.$ext.style.background = "rgba(220, 220, 220, 0.93)";
|
||||
bar.$ext.style.position = "fixed";
|
||||
bar.$ext.style.top = "75px";
|
||||
|
@ -130,6 +125,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root", "events"],
|
|||
// });
|
||||
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -25,7 +25,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
packagePath: "plugins/c9.core/settings",
|
||||
testing: true
|
||||
},
|
||||
"plugins/c9.core/api.js",
|
||||
{
|
||||
packagePath: "plugins/c9.ide.ui/ui",
|
||||
staticPrefix: "plugins/c9.ide.ui"
|
||||
|
@ -75,6 +74,7 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
"plugins/c9.vfs.client/vfs_client",
|
||||
"plugins/c9.vfs.client/endpoint",
|
||||
"plugins/c9.ide.auth/auth",
|
||||
"plugins/c9.core/api",
|
||||
|
||||
|
||||
"plugins/c9.ide.ace/ace",
|
||||
|
@ -177,6 +177,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
}
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -54,7 +54,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
}}}
|
||||
}
|
||||
},
|
||||
"plugins/c9.core/api.js",
|
||||
{
|
||||
packagePath: "plugins/c9.ide.ui/ui",
|
||||
staticPrefix: "plugins/c9.ide.ui"
|
||||
|
@ -84,6 +83,7 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
},
|
||||
"plugins/c9.vfs.client/endpoint",
|
||||
"plugins/c9.ide.auth/auth",
|
||||
"plugins/c9.core/api",
|
||||
{
|
||||
packagePath: "plugins/c9.ide.run/run",
|
||||
testing: true,
|
||||
|
@ -154,8 +154,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
|
||||
describe('run', function() {
|
||||
before(function(done) {
|
||||
apf.config.setProperty("allow-select", false);
|
||||
apf.config.setProperty("allow-blur", false);
|
||||
|
||||
bar.$ext.style.background = "rgba(220, 220, 220, 0.93)";
|
||||
bar.$ext.style.position = "fixed";
|
||||
|
@ -411,6 +409,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
}
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -29,7 +29,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
packagePath: "plugins/c9.core/settings",
|
||||
testing: true
|
||||
},
|
||||
"plugins/c9.core/api.js",
|
||||
{
|
||||
packagePath: "plugins/c9.ide.ui/ui",
|
||||
staticPrefix: "plugins/c9.ide.ui"
|
||||
|
@ -56,6 +55,7 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
},
|
||||
"plugins/c9.vfs.client/endpoint",
|
||||
"plugins/c9.ide.auth/auth",
|
||||
"plugins/c9.core/api",
|
||||
{
|
||||
packagePath: "plugins/c9.fs/fs",
|
||||
baseProc: baseProc
|
||||
|
@ -161,6 +161,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
}
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -29,7 +29,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root", "async"],
|
|||
packagePath: "plugins/c9.core/settings",
|
||||
testing: true
|
||||
},
|
||||
"plugins/c9.core/api.js",
|
||||
{
|
||||
packagePath: "plugins/c9.ide.ui/ui",
|
||||
staticPrefix: "plugins/c9.ide.ui"
|
||||
|
@ -50,6 +49,7 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root", "async"],
|
|||
"plugins/c9.vfs.client/vfs_client",
|
||||
"plugins/c9.vfs.client/endpoint",
|
||||
"plugins/c9.ide.auth/auth",
|
||||
"plugins/c9.core/api",
|
||||
{
|
||||
packagePath: "plugins/c9.fs/fs",
|
||||
baseProc: baseProc
|
||||
|
@ -107,8 +107,10 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root", "async"],
|
|||
var count = 0;
|
||||
files.slice(0, 3).forEach(function(path, i) {
|
||||
count++;
|
||||
fs.writeFile(path, path, function() {
|
||||
tabs.openFile(path, function() {
|
||||
fs.writeFile(path, path, function(err) {
|
||||
if (err) return done(err);
|
||||
tabs.openFile(path, function(err) {
|
||||
if (err) return done(err);
|
||||
if (--count === 0)
|
||||
done();
|
||||
});
|
||||
|
@ -473,6 +475,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root", "async"],
|
|||
}
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -23,7 +23,6 @@ require(["lib/architect/architect", "lib/chai/chai", "sinon"], function(architec
|
|||
packagePath: "plugins/c9.core/settings",
|
||||
testing: true
|
||||
},
|
||||
"plugins/c9.core/api.js",
|
||||
{
|
||||
packagePath: "plugins/c9.ide.ui/ui",
|
||||
staticPrefix: "plugins/c9.ide.ui"
|
||||
|
@ -38,20 +37,6 @@ require(["lib/architect/architect", "lib/chai/chai", "sinon"], function(architec
|
|||
"plugins/c9.ide.editors/tab",
|
||||
"plugins/c9.ide.terminal/terminal",
|
||||
"plugins/c9.ide.terminal.monitor/monitor",
|
||||
// "plugins/c9.ide.terminal.monitor/message_view",
|
||||
"plugins/c9.ide.preferences/preferences",
|
||||
"plugins/c9.ide.ui/forms",
|
||||
// {
|
||||
// packagePath: "plugins/c9.fs/proc",
|
||||
// tmuxName: "cloud9test"
|
||||
// },
|
||||
"plugins/c9.vfs.client/vfs_client",
|
||||
"plugins/c9.vfs.client/endpoint",
|
||||
"plugins/c9.ide.auth/auth",
|
||||
// {
|
||||
// packagePath: "plugins/c9.fs/fs",
|
||||
// baseProc: baseProc
|
||||
// },
|
||||
|
||||
{
|
||||
consumes: ["tabManager", "c9", "terminal", "terminal.monitor", "terminal.monitor.message_view"],
|
||||
|
@ -224,6 +209,6 @@ require(["lib/architect/architect", "lib/chai/chai", "sinon"], function(architec
|
|||
}
|
||||
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -25,7 +25,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root", "ace/test/asse
|
|||
packagePath: "plugins/c9.core/settings",
|
||||
testing: true
|
||||
},
|
||||
"plugins/c9.core/api.js",
|
||||
{
|
||||
packagePath: "plugins/c9.ide.ui/ui",
|
||||
staticPrefix: "plugins/c9.ide.ui"
|
||||
|
@ -50,6 +49,7 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root", "ace/test/asse
|
|||
"plugins/c9.vfs.client/vfs_client",
|
||||
"plugins/c9.vfs.client/endpoint",
|
||||
"plugins/c9.ide.auth/auth",
|
||||
"plugins/c9.core/api",
|
||||
{
|
||||
packagePath: "plugins/c9.fs/fs",
|
||||
baseProc: baseProc
|
||||
|
@ -561,6 +561,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root", "ace/test/asse
|
|||
}
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -23,7 +23,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"], function (arc
|
|||
packagePath: "plugins/c9.core/settings",
|
||||
testing: true
|
||||
},
|
||||
"plugins/c9.core/api.js",
|
||||
{
|
||||
packagePath: "plugins/c9.ide.ui/ui",
|
||||
staticPrefix: "plugins/c9.ide.ui"
|
||||
|
@ -46,6 +45,7 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"], function (arc
|
|||
"plugins/c9.vfs.client/vfs_client",
|
||||
"plugins/c9.vfs.client/endpoint",
|
||||
"plugins/c9.ide.auth/auth",
|
||||
"plugins/c9.core/api",
|
||||
{
|
||||
packagePath: "plugins/c9.fs/fs",
|
||||
baseProc: baseProc
|
||||
|
@ -297,6 +297,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"], function (arc
|
|||
}
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -34,10 +34,10 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root", "events", "ace
|
|||
"plugins/c9.core/http-xhr",
|
||||
"plugins/c9.core/util",
|
||||
"plugins/c9.core/settings",
|
||||
"plugins/c9.core/api.js",
|
||||
"plugins/c9.vfs.client/vfs_client",
|
||||
"plugins/c9.vfs.client/endpoint",
|
||||
"plugins/c9.ide.auth/auth",
|
||||
"plugins/c9.core/api",
|
||||
"plugins/c9.ide.threewaymerge/threewaymerge",
|
||||
{
|
||||
consumes: ["threewaymerge", "fs"],
|
||||
|
|
|
@ -28,7 +28,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
settings: "default",
|
||||
testing: true
|
||||
},
|
||||
"plugins/c9.core/api.js",
|
||||
{
|
||||
packagePath: "plugins/c9.ide.ui/ui",
|
||||
staticPrefix: "plugins/c9.ide.ui"
|
||||
|
@ -43,6 +42,7 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
"plugins/c9.vfs.client/vfs_client",
|
||||
"plugins/c9.vfs.client/endpoint",
|
||||
"plugins/c9.ide.auth/auth",
|
||||
"plugins/c9.core/api",
|
||||
"plugins/c9.fs/fs.cache.xml",
|
||||
|
||||
"plugins/c9.ide.dialog/dialog",
|
||||
|
@ -75,6 +75,7 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
|
||||
function getDomNode(treeNode) {
|
||||
var r = tree.tree.renderer;
|
||||
r.scrollCaretIntoView(treeNode);
|
||||
r.$renderChanges(r.$loop.changes);
|
||||
var i = r.provider.getIndexForNode(treeNode);
|
||||
return r.$cellLayer.getDomNodeAtIndex(i);
|
||||
|
@ -649,6 +650,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
}
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -94,6 +94,6 @@ require(["lib/architect/architect", "lib/chai/chai"], function (architect, chai)
|
|||
}
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -214,6 +214,6 @@ require(["lib/architect/architect", "lib/chai/chai"], function (architect, chai)
|
|||
}
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -118,6 +118,6 @@ require(["lib/architect/architect", "lib/chai/chai"], function (architect, chai)
|
|||
});
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -20,6 +20,7 @@ require(["lib/architect/architect", "lib/chai/chai"], function (architect, chai)
|
|||
"plugins/c9.vfs.client/vfs_client",
|
||||
"plugins/c9.vfs.client/endpoint",
|
||||
"plugins/c9.ide.auth/auth",
|
||||
"plugins/c9.core/api",
|
||||
{
|
||||
packagePath: "plugins/c9.fs/fs",
|
||||
baseProc: "plugins/c9.fs/mock"
|
||||
|
@ -214,6 +215,6 @@ require(["lib/architect/architect", "lib/chai/chai"], function (architect, chai)
|
|||
});
|
||||
}
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -22,7 +22,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
"plugins/c9.ide.ui/focus",
|
||||
"plugins/c9.ide.ui/lib_apf",
|
||||
"plugins/c9.core/settings",
|
||||
"plugins/c9.core/api",
|
||||
"plugins/c9.ide.ui/anims",
|
||||
{
|
||||
packagePath: "plugins/c9.ide.ui/ui",
|
||||
|
@ -44,6 +43,7 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
"plugins/c9.vfs.client/vfs_client",
|
||||
"plugins/c9.vfs.client/endpoint",
|
||||
"plugins/c9.ide.auth/auth",
|
||||
"plugins/c9.core/api",
|
||||
{
|
||||
packagePath: "plugins/c9.fs/fs",
|
||||
baseProc: baseProc
|
||||
|
@ -109,6 +109,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
}
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -23,7 +23,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
"plugins/c9.ide.ui/focus",
|
||||
"plugins/c9.ide.ui/lib_apf",
|
||||
"plugins/c9.core/settings",
|
||||
"plugins/c9.core/api.js",
|
||||
{
|
||||
packagePath: "plugins/c9.ide.ui/ui",
|
||||
staticPrefix: "plugins/c9.ide.ui"
|
||||
|
@ -46,6 +45,7 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
"plugins/c9.vfs.client/vfs_client",
|
||||
"plugins/c9.vfs.client/endpoint",
|
||||
"plugins/c9.ide.auth/auth",
|
||||
"plugins/c9.core/api",
|
||||
{
|
||||
packagePath: "plugins/c9.fs/fs",
|
||||
baseProc: baseProc
|
||||
|
@ -123,6 +123,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
}
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -29,6 +29,7 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
"plugins/c9.vfs.client/vfs_client",
|
||||
"plugins/c9.vfs.client/endpoint",
|
||||
"plugins/c9.ide.auth/auth",
|
||||
"plugins/c9.core/api",
|
||||
|
||||
{
|
||||
consumes: ["c9", "watcher", "fs"],
|
||||
|
@ -186,6 +187,6 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"],
|
|||
});
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -31,7 +31,6 @@ require([
|
|||
packagePath: "plugins/c9.core/settings",
|
||||
testing: true
|
||||
},
|
||||
"plugins/c9.core/api.js",
|
||||
"plugins/c9.ide.keys/commands",
|
||||
"plugins/c9.ide.keys/editor",
|
||||
{
|
||||
|
@ -66,6 +65,7 @@ require([
|
|||
"plugins/c9.vfs.client/vfs_client",
|
||||
"plugins/c9.vfs.client/endpoint",
|
||||
"plugins/c9.ide.auth/auth",
|
||||
"plugins/c9.core/api",
|
||||
|
||||
{
|
||||
consumes: ["tabManager", "welcome"],
|
||||
|
@ -124,6 +124,6 @@ require([
|
|||
});
|
||||
});
|
||||
|
||||
onload && onload();
|
||||
register();
|
||||
}
|
||||
});
|
|
@ -20,6 +20,7 @@ describe(__filename, function() {
|
|||
var home = vfs({
|
||||
root: path.normalize(__dirname + "/.."),
|
||||
testing: true,
|
||||
nopty: true
|
||||
});
|
||||
|
||||
wrapper = vfsWrapper(home, {
|
||||
|
|
|
@ -153,8 +153,10 @@ page.open(address, function(status) {
|
|||
var count = 0;
|
||||
var failCount = 0;
|
||||
var timeout = null;
|
||||
var suites = 0;
|
||||
|
||||
function runTest(name, next) {
|
||||
suites++;
|
||||
var subtests = 0;
|
||||
var failed = false;
|
||||
|
||||
|
@ -170,11 +172,20 @@ page.open(address, function(status) {
|
|||
|
||||
log("# %s", name);
|
||||
window.c9Test.run(name, function(errors, out) {
|
||||
if (errors) console.error(errors);
|
||||
if (!out.tests || !out.tests.length) {
|
||||
out.tests = [{
|
||||
state: "failed",
|
||||
error: "test didn't complete"
|
||||
}];
|
||||
}
|
||||
|
||||
out.tests.forEach(function(test, i) {
|
||||
count++;
|
||||
if (test.state == "passed") return log("ok %s %s", count, test.title);
|
||||
if (test.state == "failed") return fail(count, test);
|
||||
log("ok %s # SKIP %s", count, test.title);
|
||||
var index = suites + "." + i;
|
||||
if (test.state === "passed") return log("ok %s %s", index, test.title);
|
||||
if (test.state === "failed") return fail(index, test);
|
||||
log("ok %s # SKIP %s", index, test.title);
|
||||
});
|
||||
|
||||
if (failed) {
|
||||
|
|
Ładowanie…
Reference in New Issue