From 82f9b033ab946cf91d668f5f0e2052d7cafbc32a Mon Sep 17 00:00:00 2001 From: Joel Brandt Date: Mon, 12 Dec 2011 16:28:32 -0800 Subject: [PATCH 1/3] added testing niceties to the UI to allow you to reload tests after a test file is changed --- src/brackets.js | 16 ++++++++++++++++ src/index.html | 1 + test/SpecRunner.html | 18 +++++++++++++++++- 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/brackets.js b/src/brackets.js index ad783072777..28a1a87e6e0 100644 --- a/src/brackets.js +++ b/src/brackets.js @@ -17,6 +17,22 @@ $(document).ready(function() { } }); + var testWindow = null; + $("#menu-runtests").click(function(){ + if (!(testWindow === null)) { + try { + testWindow.location.reload(); + } catch(e) { + testWindow = null; // the window was probably closed + } + } + + if (testWindow === null) { + testWindow = window.open("../test/SpecRunner.html"); + testWindow.location.reload(); // if it was opened before, we need to reload because it will be cached + } + }); + function showOpenDialogCallback( files ) { diff --git a/src/index.html b/src/index.html index 60d19fbcf26..e13939df917 100644 --- a/src/index.html +++ b/src/index.html @@ -39,6 +39,7 @@
  • Quit
  • +
  • Run Tests
  • diff --git a/test/SpecRunner.html b/test/SpecRunner.html index 460fe274f59..934899d547c 100644 --- a/test/SpecRunner.html +++ b/test/SpecRunner.html @@ -5,13 +5,26 @@ Jasmine Spec Runner + + + - @@ -51,5 +64,8 @@ +
    +reload and re-run tests +
    From 88a6b592f3f9f44889eab2454ebefb4e7a2d9988 Mon Sep 17 00:00:00 2001 From: Joel Brandt Date: Mon, 12 Dec 2011 16:33:48 -0800 Subject: [PATCH 2/3] this file doesn't belong in this branch, was accidentally added --- test/spec/fileIO-test.js | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 test/spec/fileIO-test.js diff --git a/test/spec/fileIO-test.js b/test/spec/fileIO-test.js deleted file mode 100644 index 143f39fe4eb..00000000000 --- a/test/spec/fileIO-test.js +++ /dev/null @@ -1,11 +0,0 @@ -describe("FileIO", function(){ - - describe("Reading", function() { - - it("should run the test", function() { - // verify editor content - expect("a").toEqual("a"); - }); - }); -}); - From 4ff58be0e7eb97f0419a10ed6142355e093c9633 Mon Sep 17 00:00:00 2001 From: Joel Brandt Date: Mon, 12 Dec 2011 17:03:13 -0800 Subject: [PATCH 3/3] adding a comment --- src/brackets.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/brackets.js b/src/brackets.js index e7b89a8e0f7..4667f40acd3 100644 --- a/src/brackets.js +++ b/src/brackets.js @@ -17,6 +17,7 @@ $(document).ready(function() { } }); + // Implements the 'Run Tests' menu to bring up the Jasmine unit test window var testWindow = null; $("#menu-runtests").click(function(){ if (!(testWindow === null)) {