From 6b784dc574b160cabd921496db30adef859acb6f Mon Sep 17 00:00:00 2001 From: Tymoteusz Motylewski Date: Fri, 16 Mar 2018 21:58:22 +0100 Subject: [PATCH] [TASK] Fail acceptance tests on JavaScript errors in browser console Raise typo3/testing-framework to 3.3.0 composer update typo3/testing-framework Acceptance tests are configured to fail if JavaScript errors are raised in the console. See https://github.com/TYPO3/testing-framework/blob/master/Resources/Core/ Build/Configuration/Acceptance/Support/Helper/Acceptance.php This commit also fixeds a bug found by the tests. A requireJS error was thrown - timeout on loading `nprogress` from within Loader.js. Resolves: #84322 Releases: master Change-Id: Iea9b6e0c435a73be6e6a4f9567d09f35880822ab Reviewed-on: https://review.typo3.org/56196 Tested-by: TYPO3com Reviewed-by: Christian Kuhn Tested-by: Christian Kuhn Reviewed-by: Anja Leichsenring Tested-by: Anja Leichsenring Reviewed-by: Tymoteusz Motylewski Tested-by: Tymoteusz Motylewski --- composer.lock | 10 +++++----- .../Resources/Private/TypeScript/Viewport/Loader.ts | 11 ++++------- .../Resources/Public/JavaScript/Viewport/Loader.js | 2 +- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/composer.lock b/composer.lock index 0a726a9c738a..edc4866b0138 100644 --- a/composer.lock +++ b/composer.lock @@ -4457,16 +4457,16 @@ }, { "name": "typo3/testing-framework", - "version": "3.2.0", + "version": "3.3.0", "source": { "type": "git", "url": "https://github.com/TYPO3/testing-framework.git", - "reference": "da30d1b49d60b4e4150d4eae5b128c449f2347ea" + "reference": "bad054fd079e669cd3fe8271cf8ba9f418a1ff22" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/TYPO3/testing-framework/zipball/da30d1b49d60b4e4150d4eae5b128c449f2347ea", - "reference": "da30d1b49d60b4e4150d4eae5b128c449f2347ea", + "url": "https://api.github.com/repos/TYPO3/testing-framework/zipball/bad054fd079e669cd3fe8271cf8ba9f418a1ff22", + "reference": "bad054fd079e669cd3fe8271cf8ba9f418a1ff22", "shasum": "" }, "require": { @@ -4515,7 +4515,7 @@ "tests", "typo3" ], - "time": "2018-03-08T20:33:54+00:00" + "time": "2018-03-16T08:17:37+00:00" }, { "name": "webmozart/assert", diff --git a/typo3/sysext/backend/Resources/Private/TypeScript/Viewport/Loader.ts b/typo3/sysext/backend/Resources/Private/TypeScript/Viewport/Loader.ts index 611ef66b4783..1e96e0ba2268 100644 --- a/typo3/sysext/backend/Resources/Private/TypeScript/Viewport/Loader.ts +++ b/typo3/sysext/backend/Resources/Private/TypeScript/Viewport/Loader.ts @@ -12,19 +12,16 @@ */ import {ScaffoldIdentifierEnum} from '../Enum/Viewport/ScaffoldIdentifier'; +import NProgress = require('nprogress'); class Loader { public static start(): void { - require(['nprogress'], (NProgress: NProgressStatic): void => { - NProgress.configure({parent: ScaffoldIdentifierEnum.contentModule, showSpinner: false}); - NProgress.start(); - }); + NProgress.configure({parent: ScaffoldIdentifierEnum.contentModule, showSpinner: false}); + NProgress.start(); } public static finish(): void { - require(['nprogress'], (NProgress: NProgressStatic): void => { - NProgress.done(); - }); + NProgress.done(); } } diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/Viewport/Loader.js b/typo3/sysext/backend/Resources/Public/JavaScript/Viewport/Loader.js index d110671a0cec..2ab31c67e066 100644 --- a/typo3/sysext/backend/Resources/Public/JavaScript/Viewport/Loader.js +++ b/typo3/sysext/backend/Resources/Public/JavaScript/Viewport/Loader.js @@ -10,4 +10,4 @@ * * The TYPO3 project - inspiring people to share! */ -define(["require","exports","../Enum/Viewport/ScaffoldIdentifier"],function(n,t,e){"use strict";return function(){function t(){}return t.start=function(){n(["nprogress"],function(n){n.configure({parent:e.ScaffoldIdentifierEnum.contentModule,showSpinner:!1}),n.start()})},t.finish=function(){n(["nprogress"],function(n){n.done()})},t}()}); \ No newline at end of file +define(["require","exports","../Enum/Viewport/ScaffoldIdentifier","nprogress"],function(n,e,t,r){"use strict";return function(){function n(){}return n.start=function(){r.configure({parent:t.ScaffoldIdentifierEnum.contentModule,showSpinner:!1}),r.start()},n.finish=function(){r.done()},n}()}); \ No newline at end of file