1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-24 00:50:28 +00:00

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
This commit is contained in:
ento 2020-12-11 02:12:01 -08:00 committed by GitHub
parent f60d0ef109
commit ae61b08ae5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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