Skip to content

Instantly share code, notes, and snippets.

@ZER0
Created July 3, 2013 18:59
Show Gist options
  • Save ZER0/5921706 to your computer and use it in GitHub Desktop.
Save ZER0/5921706 to your computer and use it in GitHub Desktop.
diff --git a/lib/sdk/deprecated/unit-test-finder.js b/lib/sdk/deprecated/unit-test-finder.js
index 0d13265..c2268d5 100644
--- a/lib/sdk/deprecated/unit-test-finder.js
+++ b/lib/sdk/deprecated/unit-test-finder.js
@@ -55,8 +55,20 @@ TestFinder.prototype = {
function(suite) {
// Load each test file as a main module in its own loader instance
// `suite` is defined by cuddlefish/manifest.py:ManifestBuilder.build
- var loader = Loader(module);
- var module = cuddlefish.main(loader, suite);
+ let loader = Loader(module);
+ let module;
+
+ try {
+ module = cuddlefish.main(loader, suite);
+ }
+ catch(e) {
+ if (!/^Unsupported Application/.test(e.message))
+ throw e;
+
+ module = {
+ 'test Skipped': assert => assert.pass(e.message)
+ }
+ }
if (self.testInProcess)
for each (let name in Object.keys(module).sort()) {
diff --git a/lib/toolkit/loader.js b/lib/toolkit/loader.js
index 8d94ea6..fe55c1d 100644
--- a/lib/toolkit/loader.js
+++ b/lib/toolkit/loader.js
@@ -350,7 +350,7 @@ exports.Require = Require;
const main = iced(function main(loader, id) {
let uri = resolveURI(id, loader.mapping)
let module = loader.main = loader.modules[uri] = Module(id, uri);
- return load(loader, module).exports;
+ return loader.load(loader, module).exports;
});
exports.main = main;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment