Fix browser testing (#5254)

* jasmine: specify 'after' only in Node

The commands module is never executed in browsers and the 'after'
constraint caused a regression where tests were never run in the
browser.

* jasmine: give the startup module a name like all others
browser-messaging-saver
ento 2020-12-11 02:12:01 -08:00 zatwierdzone przez GitHub
rodzic f60d0ef109
commit ae61b08ae5
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 5 dodań i 4 usunięć

Wyświetl plik

@ -9,19 +9,20 @@ The main module of the Jasmine test plugin for TiddlyWiki5
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
/*global $tw: true */
"use strict";
var TEST_TIDDLER_FILTER = "[type[application/javascript]tag[$:/tags/test-spec]]";
exports.name = "jasmine";
// Ensure this startup module is executed in the right order.
// Jasmine calls `process.exit()` with a non-zero exit code if there's
// In Node.js, Jasmine calls `process.exit()` with a non-zero exit code if there's
// any failed tests. Because of that, we want to make sure all critical
// startup modules are run before this one.
// * The "commands" module handles the --rendertiddler command-line flag,
// which is typically given to export an HTML file that can be opened with
// which is typically given in order to export an HTML file that can be opened with
// a browser to run tests.
exports.after = ["commands"];
exports.after = $tw.node ? ["commands"] : [];
/*
Startup function for running tests