Disable logAll in headless mode (#1673)

Enabling logAll in just one test has the capacity to overwhelm the CI
with log output, so we disable it if the webdriver is automated.
This commit is contained in:
Alexander Petros 2023-08-06 20:06:17 -04:00 committed by GitHub
parent c126d90588
commit bfd7965dec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 9 deletions

View File

@ -183,15 +183,6 @@ describe("Core htmx API test", function(){
div3.classList.contains("foo").should.equal(true);
});
it('logAll and logNone works', function () {
var initialLogger = htmx.logger
htmx.logAll();
htmx.logger.should.not.equal(null);
htmx.logNone();
should.equal(htmx.logger, null);
htmx.logger = initialLogger;
});
it('eval can be suppressed', function () {
var calledEvent = false;
var handler = htmx.on("htmx:evalDisallowedError", function(){

View File

@ -35,6 +35,13 @@
<script src="../node_modules/sinon/pkg/sinon.js"></script>
<script src="../node_modules/mock-socket/dist/mock-socket.js"></script>
<script src="../src/htmx.js"></script>
<script>
// Do not log all the events in headless mode (the log output is enormous)
if (navigator.webdriver) {
htmx.logAll = function () { }
}
</script>
<script class="mocha-init">
mocha.setup('bdd');
mocha.checkLeaks();