Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@taichi
Last active August 29, 2015 13:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save taichi/9803501 to your computer and use it in GitHub Desktop.
Save taichi/9803501 to your computer and use it in GitHub Desktop.
Brackets Extension template.
// see.
// http://jasmine.github.io/1.3/introduction.html
// https://github.com/adobe/brackets/wiki/How-to-Write-Extensions
/*jslint vars: true, plusplus: true, devel: true, nomen: true, regexp: true, indent: 4, maxerr: 50 */
/*global define, $, brackets, describe, it, expect, beforeFirst, afterLast, beforeEach, afterEach, runs, waitsFor, waitsForDone, waitsForFail */
/*unittests: MyExtension */ // for Test Runner of https://github.com/dangoor/TestQuickly
define(function(require, exports, module) {
"use strict";
var SpecRunnerUtils = brackets.getModule("spec/SpecRunnerUtils"),
FileUtils = brackets.getModule("file/FileUtils");
describe("MyExtension", function() {
var extensionPath = FileUtils.getNativeModuleDirectoryPath(module),
fixtures = extensionPath + "/fixtures";
var target, PM, DM;
beforeFirst(function() {
SpecRunnerUtils.createTestWindowAndRun(this, function(w) {
// see. src/brackets.js#_initTest
// https://github.com/adobe/brackets/blob/master/src/brackets.js#L147
var t = w.brackets.test;
PM = t.ProjectManager;
DM = t.DocumentManager;
var req = t.ExtensionLoader.getRequireContextForExtension("MyExtension");
target = req("main");
});
});
afterLast(function() {
SpecRunnerUtils.closeTestWindow();
});
describe("main_first", function() {
beforeEach(function() {
SpecRunnerUtils.loadProjectInTestWindow(fixtures);
});
});
describe("main_second", function() {});
describe("main_third", function() {});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment