Splitting unit and integration tests in package based architecture


#1

Hello,

we like Tinytest for unit testing, but than if we want integration tests Velocity is kinda must have.
Issue is that Velocity cant run unit tests without running whole integration mirror.
How do you split various testing methods ?

I am thinking about differentiating based on env variables, for example velocity set FRAMEWORK env variable.

Any1 tested and is using something like this ?
Or are you using some other method to run various tests in separate frameworks and defining what to load for each separately ?

if (typeof process.env.FRAMEWORK === "undefined") {
    Package.onTest(function(api) {
        api.versionsFrom("METEOR@1.2");
        api.use([
            // Tinytest package includes
        ]);
        api.addFiles([
            // Tinytest file includes
        ]);
    });
} else {
    Package.onTest(function(api) {
        api.versionsFrom("METEOR@1.2");
        api.use([
            // Velocity package includes
        ]);
        api.addFiles([
            // Velocity file includes
        ]);
    });
}

#2

Ok, so that FRAMEWORK env was not being set in time, we are now using TINYTEST env variable and specifying scope, if we want just functions without meteor integration, or full integration package test.
But it works as we expect and do not need to be running 2 instances in parallel while coding.