Skip to content

Commit e22eeae

Browse files
authored
Merge pull request #5 from nobitlost/master
Sync up with electricimp master
2 parents 7ed9024 + 442a1af commit e22eeae

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

Diff for: src/ImpTestCase.nut

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
*/
2929
local ImpTestCase = class {
3030

31-
static version = [0, 5, 0];
31+
static VERSION = "1.0.0";
3232

3333
runner = null; // runner instance
3434
session = null; // session name

Diff for: src/TestRunner.nut

+9-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,14 @@ local ImpUnitRunner = class {
8484
local testCases = {};
8585

8686
foreach (rootKey, rootValue in getroottable()) {
87-
if (type(rootValue) == "class" && rootValue.getbase() == ImpTestCase) {
87+
if (type(rootValue) == "class") {
88+
local bc = rootValue.getbase();
89+
while (bc != null && bc != ImpTestCase) {
90+
bc = bc.getbase();
91+
}
92+
if (bc != ImpTestCase) {
93+
continue;
94+
}
8895
if (testClass.len() > 0 && testClass != rootKey) {
8996
continue;
9097
}
@@ -238,7 +245,7 @@ local ImpUnitRunner = class {
238245
}
239246

240247
// detect if test is async
241-
test.async <- test.result instanceof Promise;
248+
test.async <- "Promise" in getroottable() && test.result instanceof Promise;
242249

243250
if (test.async) {
244251

0 commit comments

Comments
 (0)