Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
Merge pull request #5 from adobe/joelrbrandt/unit-testing-ui
Browse files Browse the repository at this point in the history
Joelrbrandt/unit testing ui - reviewed by nj
  • Loading branch information
Narciso Jaramillo committed Dec 13, 2011
2 parents 25d55b3 + a9e5549 commit e876e67
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/brackets.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,23 @@ $(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)) {
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 ) {
var folderName = files instanceof Array ? files[0] : files;

Expand Down
1 change: 1 addition & 0 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<li><a href="#" id="menu-file-quit">Quit</a></li>
</ul>
</li>
<li><a href="#" id="menu-runtests">Run Tests</a></li>
</ul>
</div>
</div>
Expand Down
17 changes: 17 additions & 0 deletions test/SpecRunner.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,20 @@
<title>Jasmine Spec Runner</title>

<link rel="stylesheet" type="text/css" href="lib/jasmine-core/jasmine.css">

<style>
#BracketsCustom {
font-size: 11px;
font-family: Monaco, "Lucida Console", monospace;
line-height: 14px;
color: #333333;
border: thin dotted gray;
padding: 5px;
}
#BracketsCustom a { color: #333333; }
#BracketsCustom a:hover { color: #999999; }
</style>

<script type="text/javascript" src="lib/jasmine-core/jasmine.js"></script>
<script type="text/javascript" src="lib/jasmine-core/jasmine-html.js"></script>
<script type="text/javascript" src="lib/jasmine-jquery-1.3.1.js"></script>
Expand Down Expand Up @@ -50,5 +64,8 @@
</head>

<body>
<div id="BracketsCustom">
<a href="#" onclick="window.location.reload()">reload and re-run tests</a>
</div>
</body>
</html>

0 comments on commit e876e67

Please sign in to comment.