Browse Source

Merge pull request #20834 from Mugen87/dev40

Tests: Fix remaining warnings.
Michael Herzog 4 years ago
parent
commit
2287ea6171

+ 4 - 1
test/unit/src/animation/KeyframeTrack.tests.js

@@ -1,7 +1,7 @@
 /* global QUnit */
 
-import { KeyframeTrack } from '../../../../src/animation/KeyframeTrack';
 import { NumberKeyframeTrack } from '../../../../src/animation/tracks/NumberKeyframeTrack';
+import { CONSOLE_LEVEL } from '../../utils/console-wrapper';
 
 export default QUnit.module( 'Animation', () => {
 
@@ -100,7 +100,10 @@ export default QUnit.module( 'Animation', () => {
 			var invalidTrack = new NumberKeyframeTrack( '.material.opacity', [ 0, 1 ], [ 0, NaN ] );
 
 			assert.ok( validTrack.validate() );
+
+			console.level = CONSOLE_LEVEL.OFF;
 			assert.notOk( invalidTrack.validate() );
+			console.level = CONSOLE_LEVEL.DEFAULT;
 
 		} );
 

+ 4 - 0
test/unit/src/core/BufferGeometry.tests.js

@@ -21,6 +21,7 @@ import {
 	y,
 	z
 } from '../math/Constants.tests';
+import { CONSOLE_LEVEL } from '../../utils/console-wrapper';
 
 var DegToRad = Math.PI / 180;
 
@@ -769,7 +770,10 @@ export default QUnit.module( 'Core', () => {
 
 			}
 
+			console.level = CONSOLE_LEVEL.ERROR;
 			geometry1.merge( geometry2 );
+			console.level = CONSOLE_LEVEL.DEFAULT;
+
 			assert.ok( attr[ 0 ] === 4 && attr[ 1 ] === 5 && attr[ 2 ] === 6, "copied the 3 attributes without offset" );
 
 		} );

+ 2 - 12
test/unit/src/helpers/BoxHelper.tests.js

@@ -13,23 +13,13 @@ export default QUnit.module( 'Helpers', () => {
 		var geometries = undefined;
 		hooks.beforeEach( function () {
 
-			const parameters = {
-				radius: 10,
-				widthSegments: 20,
-				heightSegments: 30,
-				phiStart: 0.5,
-				phiLength: 1.0,
-				thetaStart: 0.4,
-				thetaLength: 2.0,
-			};
-
 			// Test with a normal cube and a box helper
-			var boxGeometry = new BoxGeometry( parameters.diameter );
+			var boxGeometry = new BoxGeometry();
 			var box = new Mesh( boxGeometry );
 			var boxHelper = new BoxHelper( box );
 
 			// The same should happen with a comparable sphere
-			var sphereGeometry = new SphereGeometry( parameters.diameter / 2 );
+			var sphereGeometry = new SphereGeometry();
 			var sphere = new Mesh( sphereGeometry );
 			var sphereBoxHelper = new BoxHelper( sphere );
 

+ 17 - 1
test/unit/src/math/Color.tests.js

@@ -125,7 +125,7 @@ export default QUnit.module( 'Maths', () => {
 			assert.ok( hsl.l == 0.75, "lightness: " + hsl.l );
 
 			hsl = { h: 0, s: 0, l: 0 };
-			a.setStyle( "hsl(270,50%,75%,0.5)" );
+			a.setStyle( "hsl(270,50%,75%)" );
 			a.getHSL( hsl );
 			assert.ok( hsl.h == 0.75, "hue: " + hsl.h );
 			assert.ok( hsl.s == 0.5, "saturation: " + hsl.s );
@@ -528,7 +528,11 @@ export default QUnit.module( 'Maths', () => {
 		QUnit.test( "setStyleRGBAPercent", ( assert ) => {
 
 			var c = new Color();
+
+			console.level = CONSOLE_LEVEL.ERROR;
 			c.setStyle( 'rgba(100%,50%,10%, 0.5)' );
+			console.level = CONSOLE_LEVEL.DEFAULT;
+
 			assert.ok( c.r == 1, "Red: " + c.r );
 			assert.ok( c.g == 0.5, "Green: " + c.g );
 			assert.ok( c.b == 0.1, "Blue: " + c.b );
@@ -548,7 +552,11 @@ export default QUnit.module( 'Maths', () => {
 		QUnit.test( "setStyleRGBAPercentWithSpaces", ( assert ) => {
 
 			var c = new Color();
+
+			console.level = CONSOLE_LEVEL.ERROR;
 			c.setStyle( 'rgba( 100% ,50%  ,  10%, 0.5 )' );
+			console.level = CONSOLE_LEVEL.DEFAULT;
+
 			assert.ok( c.r == 1, "Red: " + c.r );
 			assert.ok( c.g == 0.5, "Green: " + c.g );
 			assert.ok( c.b == 0.1, "Blue: " + c.b );
@@ -568,7 +576,11 @@ export default QUnit.module( 'Maths', () => {
 		QUnit.test( "setStyleHSLARed", ( assert ) => {
 
 			var c = new Color();
+
+			console.level = CONSOLE_LEVEL.ERROR;
 			c.setStyle( 'hsla(360,100%,50%,0.5)' );
+			console.level = CONSOLE_LEVEL.DEFAULT;
+
 			assert.ok( c.r == 1, "Red: " + c.r );
 			assert.ok( c.g === 0, "Green: " + c.g );
 			assert.ok( c.b === 0, "Blue: " + c.b );
@@ -588,7 +600,11 @@ export default QUnit.module( 'Maths', () => {
 		QUnit.test( "setStyleHSLARedWithSpaces", ( assert ) => {
 
 			var c = new Color();
+
+			console.level = CONSOLE_LEVEL.ERROR;
 			c.setStyle( 'hsla( 360,  100% , 50%,  0.5 )' );
+			console.level = CONSOLE_LEVEL.DEFAULT;
+
 			assert.ok( c.r == 1, "Red: " + c.r );
 			assert.ok( c.g === 0, "Green: " + c.g );
 			assert.ok( c.b === 0, "Blue: " + c.b );