- fix tests on safetybelt

- garantee fibers is disabled when run travis tests
This commit is contained in:
denihs
2023-03-27 14:55:15 -04:00
parent 55deabb6e7
commit e9f78a4ce4
4 changed files with 19 additions and 10 deletions

View File

@@ -4,12 +4,14 @@ Package.describe({
});
Package.onUse(function (api) {
api.use("ecmascript");
api.use("webapp", "server");
api.addFiles("reload-safety-belt.js", "server");
api.addAssets("safetybelt.js", "server");
});
Package.onTest(function (api) {
api.use("ecmascript");
api.addAssets("safetybelt.js", "server");
api.use(["reload-safetybelt", "tinytest", "http", "webapp", "underscore"]);
api.addFiles("reload-safety-belt-tests.js", "server");

View File

@@ -1,10 +1,11 @@
var script = Assets.getText("safetybelt.js");
await (async () => {
var script = await Assets.getText("safetybelt.js");
Tinytest.add("reload-safetybelt - safety belt is added", function (test) {
test.isTrue(_.some(
WebAppInternals.additionalStaticJs,
function (js, pathname) {
return js === script;
}
));
});
Tinytest.add("reload-safetybelt - safety belt is added", function (test) {
test.isTrue(
_.some(WebAppInternals.additionalStaticJs, function (js, pathname) {
return js === script;
})
);
});
})();

View File

@@ -3,4 +3,6 @@
// chance of hitting an old server for the HTML and the new server for the JS or
// CSS. This prevents you from displaying the page in that case, and instead
// reloads it, presumably all on the new version now.
WebAppInternals.addStaticJs(Assets.getText("safetybelt.js"));
await (async () => {
WebAppInternals.addStaticJs(await Assets.getText("safetybelt.js"));
})();

View File

@@ -10,6 +10,10 @@ export METEOR_HOME=`pwd`
export phantom=$phantom
# force fibers to be disabled
export DISABLE_FIBERS=1
export IGNORE_ASYNC_PLUGIN=1
# only install dependencies if required
if [ "$phantom" = true ]
then