From 8a4a74406beafad4523bc650fc1bbbf1e2f193e8 Mon Sep 17 00:00:00 2001 From: Rob Brackett Date: Wed, 17 Jan 2024 11:42:26 -0800 Subject: [PATCH 01/11] Upgrade grunt-contrib-jasmine to v1.2 This is the latest v1.x release, and allows Jasmine browser tests to work in modern Node.js releases (Node.js v12+). The latest version is actually v4, but we can't upgrade to v2+ because there is no compatible version of grunt-template-jasmine-istanbul (top-of-tree there is compatible, but was never released and apparently has unaddressed test failures; developed appears to be stopped, so we also can't expect a future release). --- .editorconfig | 3 +++ package.json | 2 +- test/console-fallback-test.js | 6 ++++++ test/global-integration-with-new-context.js | 13 +++++++++++++ test/global-integration.js | 13 +++++++++++++ test/integration-smoke-test.js | 6 ++++++ test/test-helpers.js | 11 +++++++++++ .../src/template-jasmine-requirejs.js | 11 ++++++++--- 8 files changed, 61 insertions(+), 4 deletions(-) diff --git a/.editorconfig b/.editorconfig index f5d573b..4403be2 100644 --- a/.editorconfig +++ b/.editorconfig @@ -22,3 +22,6 @@ indent_size = 2 [*.{yaml,yml}] indent_size = 2 + +[vendor/grunt-template-jasmine-requirejs/**/*] +indent_size = 2 diff --git a/package.json b/package.json index 6cdf894..eb75240 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "grunt-contrib-clean": "^1.1.0", "grunt-contrib-concat": "~0.5.0", "grunt-contrib-connect": "^1.0.2", - "grunt-contrib-jasmine": "~1.0.3", + "grunt-contrib-jasmine": "^1.2.0", "grunt-contrib-jshint": "^1.1.0", "grunt-contrib-uglify": "^3.4.0", "grunt-contrib-watch": "^1.1.0", diff --git a/test/console-fallback-test.js b/test/console-fallback-test.js index 16fbb46..6bb5138 100644 --- a/test/console-fallback-test.js +++ b/test/console-fallback-test.js @@ -16,6 +16,12 @@ define(['../lib/loglevel', 'test/test-helpers'], function(log, testHelpers) { var originalConsole = window.console; describe("Fallback functionality:", function() { + beforeEach(function() { + jasmine.addMatchers({ + nothing: testHelpers.nothing + }); + }); + describe("with no console present", function() { beforeEach(function() { window.console = undefined; diff --git a/test/global-integration-with-new-context.js b/test/global-integration-with-new-context.js index 95cea84..cc530b6 100644 --- a/test/global-integration-with-new-context.js +++ b/test/global-integration-with-new-context.js @@ -2,6 +2,19 @@ "use strict"; describe("loglevel from a global <% with (scripts) { %> - <% [].concat(jasmine, boot, helpers).forEach(function(script){ %> + <% /* LOGLEVEL-FORK: Include new script types used by grunt-contrib-jasmine v4 */ %> + <% [].concat(polyfills, jasmine, boot, boot2, helpers).forEach(function(script){ %> <% }) %> + <% /* END LOGLEVEL-FORK */ %> <% }; %>