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

javascript quick edit unit tests #943

Merged
merged 22 commits into from
May 29, 2012
Merged

javascript quick edit unit tests #943

merged 22 commits into from
May 29, 2012

Conversation

redmunds
Copy link
Contributor

First pass at unit tests for an extension. The unittests.js file, if it exists, is executed for each extension in user or default folder.

Added FileUtils.getNativeModuleDirectoryPath() api call to help extension author access files in the extension folder.

@ghost ghost assigned jasonsanjose May 25, 2012
@jasonsanjose
Copy link
Member

reviewing

@@ -324,7 +323,16 @@ define(function (require, exports, module) {

PerfUtils.addMeasurement("Application Startup");

ProjectManager.loadProject();
});
// load project before loading extensions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops. This was me. The comment should read extensions before project.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@jasonsanjose
Copy link
Member

Initial review complete. Need to merge with master.

if (module && module.uri) {

// Remove window name from base path. Maintain trailing slash.
pathname = window.location.pathname;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to explicitly decode the URI returned from window.location.pathname by calling decodeURI() as I did in #922.

Without this call the path is encoded with %XX for all non-English characters and users who install or run Brackets from a path with some non-English characters will have issues in launching.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

}
}

Async.doInParallel(extensions, function (item) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should doSequentially() be used here to enforce loading in a particular order (I guess testing in parallel is ok)?

That seems a bit wasteful, it would be nice to have something like loadInParallelThenExecuteSequentiallyInOriginalOrder().

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests won't run in parallel, they'll just load. But yes, their load order will be unstable. The new SpecRunner will sort all suites alphabetically.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants