MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / runTest

Function runTest

test/embind/imvu_test_adapter.js:55–91  ·  view source on GitHub ↗
(test, continuation)

Source from the content-addressed store, hash-verified

53 }
54
55 function runTest(test, continuation) {
56 try {
57 var afterTests = [];
58
59 for (var i = 0; i < superFixtures.length; ++i) {
60 var superFixture = superFixtures[i];
61
62 var superScope = {};
63 superFixture.beforeTest.call(superScope);
64 afterTests.push(superFixture.afterTest.bind(superScope));
65 }
66
67 var testScope = test.fixture ?
68 Object.create(test.fixture.scope) :
69 {};
70
71 var runSetUp = function(fixtureObject) {
72 if (undefined === fixtureObject) {
73 return;
74 }
75 runSetUp(fixtureObject.parent);
76 fixtureObject.setUp.call(testScope);
77 afterTests.push(fixtureObject.tearDown.bind(testScope));
78 };
79 runSetUp(test.fixture);
80
81 test.body.call(testScope);
82 while (afterTests.length) {
83 afterTests.pop()();
84 }
85 return false;
86 } catch (e) {
87 console.error(e.stack);
88 console.error('error:', e);
89 return {stack: e.stack, e: e};
90 }
91 }
92
93 function run_tests(reporter, filter = undefined) {
94 let testsToRun = allTests;

Callers 1

run_testsFunction · 0.70

Calls 6

runSetUpFunction · 0.85
callMethod · 0.45
pushMethod · 0.45
createMethod · 0.45
popMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected