Merge pull request #12661 from meteor/chore/solving-2.13-tests

Chore/solving 2.13 tests
This commit is contained in:
Gabriel Grubba
2023-05-30 14:59:15 -03:00
committed by GitHub
3 changed files with 13 additions and 14 deletions

View File

@@ -99,7 +99,7 @@ Meteor.publish({
async publicationObjectAsync() {
await sleep(50);
let callback = onSubscriptions;
if (callback) callback();
if (callback) callback("publicationObjectAsync");
this.stop();
},
});
@@ -108,7 +108,7 @@ Meteor.publish({
publication_object_async: async function() {
await sleep(50);
let callback = onSubscriptions;
if (callback) callback();
if (callback) callback("publication_object_async");
this.stop();
},
});
@@ -116,7 +116,7 @@ Meteor.publish({
Meteor.publish('publication_compatibility_async', async function() {
await sleep(50);
let callback = onSubscriptions;
if (callback) callback();
if (callback) callback("publication_compatibility_async");
this.stop();
});
@@ -128,10 +128,12 @@ Tinytest.addAsync('livedata server - async publish object', function(
let testsLength = 0;
onSubscriptions = function(subscription) {
delete onSubscriptions;
clientConn.disconnect();
// for debugging
// console.log('subscription is ok:', subscription)
testsLength++;
if (testsLength == 3) {
delete onSubscriptions;
if (testsLength === 3) {
clientConn.disconnect();
onComplete();
}
};

View File

@@ -1,7 +1,7 @@
// Global flag for phantomjs (or other browser) to eval to see if we're done.
DONE = false;
// Failure count for phantomjs exit code
FAILURES = null;
FAILURES = 0;
// Where are the failures
WHERE_FAILED = [];
// Passed count for phantomjs exit code
@@ -9,7 +9,7 @@ PASSED = null;
TEST_STATUS = {
DONE: false,
FAILURES: null,
FAILURES: 0,
PASSED: null,
WHERE_FAILED: []
};
@@ -149,6 +149,7 @@ runTests = function () {
else
log("Test failed with exception");
failed++;
whereFailed.push({ name: name, info: JSON.stringify(event) });
break;
case "finish":
switch (resultSet[name].status) {

View File

@@ -29,7 +29,7 @@ async function runNextUrl(browser) {
to run more than once. in the console. Test number total: ${ testNumber }`);
console.log(`Tests complete with ${ failCount } failures`);
console.log(`Tests complete with ${ await getPassCount(page) } passes`);
if (failCount >= 0) {
if (failCount > 0) {
const failed = await getFailed(page);
failed.map((f) => console.log(`${ f.name } failed: ${ f.info }`));
await page.close();
@@ -89,11 +89,7 @@ async function getFailCount(page) {
return TEST_STATUS.FAILURES;
}
if (typeof FAILURES === 'undefined') {
return 1;
}
return 0;
return typeof FAILURES !== 'undefined' && FAILURES;
});
}