This repository has been archived by the owner on Sep 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Followup updates to #4581 and #4598 #4629
Merged
+33
−17
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -368,10 +368,10 @@ define(function (require, exports, module) { | |
var promise = _testWindow.executeCommand(_testWindow.brackets.test.Commands.FILE_CLOSE_ALL); | ||
waitsForDone(promise, "Close all open files in working set"); | ||
|
||
var $dlg = _testWindow.$(".modal.instance"); | ||
if ($dlg.length) { | ||
clickDialogButton("dontsave"); | ||
} | ||
_testWindow.brackets.test.Dialogs.cancelModalDialogIfOpen( | ||
_testWindow.brackets.test.DefaultDialogs.DIALOG_ID_SAVE_CLOSE, | ||
_testWindow.brackets.test.DefaultDialogs.DIALOG_BTN_DONTSAVE | ||
); | ||
}); | ||
}; | ||
}); | ||
|
@@ -1036,6 +1036,22 @@ define(function (require, exports, module) { | |
_addSuiteFunction("afterLast", func); | ||
}; | ||
|
||
/** | ||
* @private | ||
* Returns an array with the parent suites of the current spec with the top most suite last | ||
* @return {Array.<jasmine.Suite>} | ||
*/ | ||
function _getParentSuites() { | ||
var suite = jasmine.getEnv().currentSpec.suite, | ||
suites = []; | ||
|
||
while (suite) { | ||
suites.push(suite); | ||
suite = suite.parentSuite; | ||
} | ||
return suites; | ||
} | ||
|
||
/** | ||
* @private | ||
* Calls each function in the given array of functions | ||
|
@@ -1049,30 +1065,29 @@ define(function (require, exports, module) { | |
} | ||
|
||
/** | ||
* Calls the before first functions for the parent suites of the current spec when is the first spec of each suite. | ||
* Calls the before first functions for the parent suites of the current spec when is the first spec of the suite. | ||
*/ | ||
function runBeforeFirst() { | ||
var suite = jasmine.getEnv().currentSpec.suite; | ||
var suites = _getParentSuites().reverse(); | ||
|
||
// Iterate throught all the parent suites of the current spec | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo |
||
while (suite) { | ||
suites.forEach(function (suite) { | ||
// If we have functions for this suite and it was never called, initialize the spec counter | ||
if (_testSuites[suite.id] && _testSuites[suite.id].specCounter === null) { | ||
_callFunctions(_testSuites[suite.id].beforeFirst); | ||
_testSuites[suite.id].specCounter = countSpecs(suite); | ||
} | ||
suite = suite.parentSuite; | ||
} | ||
}); | ||
} | ||
|
||
/** | ||
* Calls the after last functions for the parent suites of the current spec when is the last spec of each suite. | ||
* Calls the after last functions for the parent suites of the current spec when is the last spec of the suite. | ||
*/ | ||
function runAfterLast() { | ||
var suite = jasmine.getEnv().currentSpec.suite; | ||
var suites = _getParentSuites(); | ||
|
||
// Iterate throught all the parent suites of the current spec | ||
while (suite) { | ||
suites.forEach(function (suite) { | ||
// If we have functions for this suite, reduce the spec counter | ||
if (_testSuites[suite.id] && _testSuites[suite.id].specCounter > 0) { | ||
_testSuites[suite.id].specCounter--; | ||
|
@@ -1083,8 +1098,7 @@ define(function (require, exports, module) { | |
delete _testSuites[suite.id]; | ||
} | ||
} | ||
suite = suite.parentSuite; | ||
} | ||
}); | ||
} | ||
|
||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a bad merge. This was
buttonId || DIALOG_CANCELED
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, yeah... good catch!