2
0
Эх сурвалжийг харах

Tests: Unit Tests for Lights (#25393)

* Update AmbientLight.tests.js

AmbientLight extends from Light.
AmbientLight.type should be AmbientLight.
AmbientLight.isAmbientLight should be true.
Correct module name.

* Add AmbientLightProbe unit tests.

Add AmbientLightProbe unit tests.
AmbientLightProbe extends from LightProbe.
AmbientLightProbe.isAmbientLightProbe should be true

* Update DirectionalLight.tests.js

DirectionalLight extends from Light.
DirectionalLight.type should be DirectionalLight.
DirectionalLight.isDirectionalLight should be true.
Stub missing member tests.

* Update DirectionalLightShadow.tests.js

DirectionalLightShadow extends from LightShadow.
DirectionalLightShadow.isDirectionalLightShadow should be true.

* Update HemisphereLight.tests.js

HemisphereLight extends from Light.
HemisphereLight.type should be HemisphereLight.
HemisphereLight.isHemisphereLight should be true.

* Add HemisphereLightProbe unit tests.

Add HemisphereLightProbe unit tests.
HemisphereLightProbe extends from LightProbe.
HemisphereLightProbe.isHemisphereLightProbe should be true.

* Update Light.tests.js

Light extends from Object3D.
Light.isLight should be true.
Stub missing member tests.

* Add LightProbe unit tests.

Add LightProbe unit tests.
LightProbe extends from Light.
LightProbe.isLightProbe should be true.

* Update LightShadow.tests.js

Stub missing member tests.

* Update PointLight.tests.js

PointLight extends from Light.
PointLight.type should be PointLight.
PointLight.isPointLight should be true.
Stub missing member tests.

* Add PointLightShadow unit tests.

Add PointLightShadow unit tests.
PointLightShadow extends from LightShadow.
PointLightShadow.isPointLightShadow should be true.

* Update SpotLightShadow.tests.js

SpotLightShadow extends from LightShadow.
SpotLightShadow.isSpotLightShadow should be true.
Stub missing member test.

* Update SpotLight.tests.js

SpotLight extends from Light.
SpotLight.type should be SpotLight.
SpotLight.isSpotLight should be true.
Stub missing member tests.

* Update RectAreaLight.tests.js

RectAreaLight extends from Light.
RectAreaLight.type should be RectAreaLight.
RectAreaLight.isRectAreaLight should be true.
Add power / Intensity tests.

* Explicit block scope for variables.

Make tests more robust.
Ed Preston 2 жил өмнө
parent
commit
df181a2086

+ 29 - 8
test/unit/src/lights/AmbientLight.tests.js

@@ -1,13 +1,15 @@
 /* global QUnit */
 
-import { runStdLightTests } from '../../utils/qunit-utils.js';
 import { AmbientLight } from '../../../../src/lights/AmbientLight.js';
 
+import { Light } from '../../../../src/lights/Light.js';
+import { runStdLightTests } from '../../utils/qunit-utils.js';
+
 export default QUnit.module( 'Lights', () => {
 
-	QUnit.module( 'ArrowHelper', ( hooks ) => {
+	QUnit.module( 'AmbientLight', ( hooks ) => {
 
-		var lights = undefined;
+		let lights = undefined;
 		hooks.beforeEach( function () {
 
 			const parameters = {
@@ -24,9 +26,13 @@ export default QUnit.module( 'Lights', () => {
 		} );
 
 		// INHERITANCE
-		QUnit.todo( 'Extending', ( assert ) => {
+		QUnit.test( 'Extending', ( assert ) => {
 
-			assert.ok( false, 'everything\'s gonna be alright' );
+			const object = new AmbientLight();
+			assert.strictEqual(
+				object instanceof Light, true,
+				'AmbientLight extends from Light'
+			);
 
 		} );
 
@@ -37,10 +43,25 @@ export default QUnit.module( 'Lights', () => {
 
 		} );
 
-		// PUBLIC STUFF
-		QUnit.todo( 'isAmbiantLight', ( assert ) => {
+		// PROPERTIES
+		QUnit.test( 'type', ( assert ) => {
 
-			assert.ok( false, 'everything\'s gonna be alright' );
+			const object = new AmbientLight();
+			assert.ok(
+				object.type === 'AmbientLight',
+				'AmbientLight.type should be AmbientLight'
+			);
+
+		} );
+
+		// PUBLIC
+		QUnit.test( 'isAmbientLight', ( assert ) => {
+
+			const object = new AmbientLight();
+			assert.ok(
+				object.isAmbientLight,
+				'AmbientLight.isAmbientLight should be true'
+			);
 
 		} );
 

+ 42 - 0
test/unit/src/lights/AmbientLightProbe.tests.js

@@ -0,0 +1,42 @@
+/* global QUnit */
+
+import { AmbientLightProbe } from '../../../../src/lights/AmbientLightProbe.js';
+
+import { LightProbe } from '../../../../src/lights/LightProbe.js';
+
+export default QUnit.module( 'Lights', () => {
+
+	QUnit.module( 'AmbientLightProbe', () => {
+
+		// INHERITANCE
+		QUnit.test( 'Extending', ( assert ) => {
+
+			const object = new AmbientLightProbe();
+			assert.strictEqual(
+				object instanceof LightProbe, true,
+				'AmbientLightProbe extends from LightProbe'
+			);
+
+		} );
+
+		// INSTANCING
+		QUnit.todo( 'Instancing', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		// PUBLIC
+		QUnit.test( 'isAmbientLightProbe', ( assert ) => {
+
+			const object = new AmbientLightProbe();
+			assert.ok(
+				object.isAmbientLightProbe,
+				'AmbientLightProbe.isAmbientLightProbe should be true'
+			);
+
+		} );
+
+	} );
+
+} );

+ 52 - 6
test/unit/src/lights/DirectionalLight.tests.js

@@ -1,13 +1,15 @@
 /* global QUnit */
 
-import { runStdLightTests } from '../../utils/qunit-utils.js';
 import { DirectionalLight } from '../../../../src/lights/DirectionalLight.js';
 
+import { Light } from '../../../../src/lights/Light.js';
+import { runStdLightTests } from '../../utils/qunit-utils.js';
+
 export default QUnit.module( 'Lights', () => {
 
 	QUnit.module( 'DirectionalLight', ( hooks ) => {
 
-		var lights = undefined;
+		let lights = undefined;
 		hooks.beforeEach( function () {
 
 			const parameters = {
@@ -24,9 +26,13 @@ export default QUnit.module( 'Lights', () => {
 		} );
 
 		// INHERITANCE
-		QUnit.todo( 'Extending', ( assert ) => {
+		QUnit.test( 'Extending', ( assert ) => {
 
-			assert.ok( false, 'everything\'s gonna be alright' );
+			const object = new DirectionalLight();
+			assert.strictEqual(
+				object instanceof Light, true,
+				'DirectionalLight extends from Light'
+			);
 
 		} );
 
@@ -37,9 +43,49 @@ export default QUnit.module( 'Lights', () => {
 
 		} );
 
-		// PUBLIC STUFF
-		QUnit.todo( 'isDirectionalLight', ( assert ) => {
+		// PROPERTIES
+		QUnit.test( 'type', ( assert ) => {
+
+			const object = new DirectionalLight();
+			assert.ok(
+				object.type === 'DirectionalLight',
+				'DirectionalLight.type should be DirectionalLight'
+			);
+
+		} );
+
+		QUnit.todo( 'position', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		QUnit.todo( 'target', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		QUnit.todo( 'shadow', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		// PUBLIC
+		QUnit.test( 'isDirectionalLight', ( assert ) => {
+
+			const object = new DirectionalLight();
+			assert.ok(
+				object.isDirectionalLight,
+				'DirectionalLight.isDirectionalLight should be true'
+			);
+
+		} );
+
+		QUnit.todo( 'dispose', ( assert ) => {
 
+			// dispose() is called on shadow
 			assert.ok( false, 'everything\'s gonna be alright' );
 
 		} );

+ 31 - 12
test/unit/src/lights/DirectionalLightShadow.tests.js

@@ -1,17 +1,23 @@
 /* global QUnit */
 
+import { DirectionalLightShadow } from '../../../../src/lights/DirectionalLightShadow.js';
+
+import { LightShadow } from '../../../../src/lights/LightShadow.js';
 import { ObjectLoader } from '../../../../src/loaders/ObjectLoader.js';
 import { DirectionalLight } from '../../../../src/lights/DirectionalLight.js';
-import { DirectionalLightShadow } from '../../../../src/lights/DirectionalLightShadow.js';
 
 export default QUnit.module( 'Lights', () => {
 
 	QUnit.module( 'DirectionalLightShadow', () => {
 
 		// INHERITANCE
-		QUnit.todo( 'Extending', ( assert ) => {
+		QUnit.test( 'Extending', ( assert ) => {
 
-			assert.ok( false, 'everything\'s gonna be alright' );
+			const object = new DirectionalLightShadow();
+			assert.strictEqual(
+				object instanceof LightShadow, true,
+				'DirectionalLightShadow extends from LightShadow'
+			);
 
 		} );
 
@@ -22,16 +28,26 @@ export default QUnit.module( 'Lights', () => {
 
 		} );
 
+		// PUBLIC
+		QUnit.test( 'isDirectionalLightShadow', ( assert ) => {
+
+			const object = new DirectionalLightShadow();
+			assert.ok(
+				object.isDirectionalLightShadow,
+				'DirectionalLightShadow.isDirectionalLightShadow should be true'
+			);
+
+		} );
+
 		// OTHERS
 		QUnit.test( 'clone/copy', ( assert ) => {
 
-			var a = new DirectionalLightShadow();
-			var b = new DirectionalLightShadow();
-			var c;
+			const a = new DirectionalLightShadow();
+			const b = new DirectionalLightShadow();
 
 			assert.notDeepEqual( a, b, 'Newly instanced shadows are not equal' );
 
-			c = a.clone();
+			const c = a.clone();
 			assert.smartEqual( a, c, 'Shadows are identical after clone()' );
 
 			c.mapSize.set( 1024, 1024 );
@@ -47,18 +63,21 @@ export default QUnit.module( 'Lights', () => {
 
 		QUnit.test( 'toJSON', ( assert ) => {
 
-			var light = new DirectionalLight();
-			var shadow = new DirectionalLightShadow();
+			const light = new DirectionalLight();
+			const shadow = new DirectionalLightShadow();
 
 			shadow.bias = 10;
 			shadow.radius = 5;
 			shadow.mapSize.set( 1024, 1024 );
 			light.shadow = shadow;
 
-			var json = light.toJSON();
-			var newLight = new ObjectLoader().parse( json );
+			const json = light.toJSON();
+			const newLight = new ObjectLoader().parse( json );
 
-			assert.smartEqual( newLight.shadow, light.shadow, 'Reloaded shadow is identical to the original one' );
+			assert.smartEqual(
+				newLight.shadow, light.shadow,
+				'Reloaded shadow is identical to the original one'
+			);
 
 		} );
 

+ 40 - 6
test/unit/src/lights/HemisphereLight.tests.js

@@ -1,13 +1,15 @@
 /* global QUnit */
 
-import { runStdLightTests } from '../../utils/qunit-utils.js';
 import { HemisphereLight } from '../../../../src/lights/HemisphereLight.js';
 
+import { Light } from '../../../../src/lights/Light.js';
+import { runStdLightTests } from '../../utils/qunit-utils.js';
+
 export default QUnit.module( 'Lights', () => {
 
 	QUnit.module( 'HemisphereLight', ( hooks ) => {
 
-		var lights = undefined;
+		let lights = undefined;
 		hooks.beforeEach( function () {
 
 			const parameters = {
@@ -26,9 +28,13 @@ export default QUnit.module( 'Lights', () => {
 		} );
 
 		// INHERITANCE
-		QUnit.todo( 'Extending', ( assert ) => {
+		QUnit.test( 'Extending', ( assert ) => {
 
-			assert.ok( false, 'everything\'s gonna be alright' );
+			const object = new HemisphereLight();
+			assert.strictEqual(
+				object instanceof Light, true,
+				'HemisphereLight extends from Light'
+			);
 
 		} );
 
@@ -39,15 +45,43 @@ export default QUnit.module( 'Lights', () => {
 
 		} );
 
-		// PUBLIC STUFF
-		QUnit.todo( 'isHemisphereLight', ( assert ) => {
+		// PROPERTIES
+		QUnit.test( 'type', ( assert ) => {
+
+			const object = new HemisphereLight();
+			assert.ok(
+				object.type === 'HemisphereLight',
+				'HemisphereLight.type should be HemisphereLight'
+			);
+
+		} );
+
+		QUnit.todo( 'position', ( assert ) => {
 
 			assert.ok( false, 'everything\'s gonna be alright' );
 
 		} );
 
+		QUnit.todo( 'groundColor', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		// PUBLIC
+		QUnit.test( 'isHemisphereLight', ( assert ) => {
+
+			const object = new HemisphereLight();
+			assert.ok(
+				object.isHemisphereLight,
+				'HemisphereLight.isHemisphereLight should be true'
+			);
+
+		} );
+
 		QUnit.todo( 'copy', ( assert ) => {
 
+			// copy( source, recursive )
 			assert.ok( false, 'everything\'s gonna be alright' );
 
 		} );

+ 42 - 0
test/unit/src/lights/HemisphereLightProbe.tests.js

@@ -0,0 +1,42 @@
+/* global QUnit */
+
+import { HemisphereLightProbe } from '../../../../src/lights/HemisphereLightProbe.js';
+
+import { LightProbe } from '../../../../src/lights/LightProbe.js';
+
+export default QUnit.module( 'Lights', () => {
+
+	QUnit.module( 'HemisphereLightProbe', () => {
+
+		// INHERITANCE
+		QUnit.test( 'Extending', ( assert ) => {
+
+			const object = new HemisphereLightProbe();
+			assert.strictEqual(
+				object instanceof LightProbe, true,
+				'HemisphereLightProbe extends from LightProbe'
+			);
+
+		} );
+
+		// INSTANCING
+		QUnit.todo( 'Instancing', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		// PUBLIC
+		QUnit.test( 'isHemisphereLightProbe', ( assert ) => {
+
+			const object = new HemisphereLightProbe();
+			assert.ok(
+				object.isHemisphereLightProbe,
+				'HemisphereLightProbe.isHemisphereLightProbe should be true'
+			);
+
+		} );
+
+	} );
+
+} );

+ 46 - 6
test/unit/src/lights/Light.tests.js

@@ -1,13 +1,15 @@
 /* global QUnit */
 
-import { runStdLightTests } from '../../utils/qunit-utils.js';
 import { Light } from '../../../../src/lights/Light.js';
 
+import { Object3D } from '../../../../src/core/Object3D.js';
+import { runStdLightTests } from '../../utils/qunit-utils.js';
+
 export default QUnit.module( 'Lights', () => {
 
 	QUnit.module( 'Light', ( hooks ) => {
 
-		var lights = undefined;
+		let lights = undefined;
 		hooks.beforeEach( function () {
 
 			const parameters = {
@@ -24,9 +26,13 @@ export default QUnit.module( 'Lights', () => {
 		} );
 
 		// INHERITANCE
-		QUnit.todo( 'Extending', ( assert ) => {
+		QUnit.test( 'Extending', ( assert ) => {
 
-			assert.ok( false, 'everything\'s gonna be alright' );
+			const object = new Light();
+			assert.strictEqual(
+				object instanceof Object3D, true,
+				'Light extends from Object3D'
+			);
 
 		} );
 
@@ -37,9 +43,43 @@ export default QUnit.module( 'Lights', () => {
 
 		} );
 
-		// PUBLIC STUFF
-		QUnit.todo( 'isLight', ( assert ) => {
+		// PROPERTIES
+		QUnit.test( 'type', ( assert ) => {
+
+			const object = new Light();
+			assert.ok(
+				object.type === 'Light',
+				'Light.type should be Light'
+			);
+
+		} );
+
+		QUnit.todo( 'color', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		QUnit.todo( 'intensity', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		// PUBLIC
+		QUnit.test( 'isLight', ( assert ) => {
+
+			const object = new Light();
+			assert.ok(
+				object.isLight,
+				'Light.isLight should be true'
+			);
+
+		} );
+
+		QUnit.todo( 'dispose', ( assert ) => {
 
+			// empty, test exists
 			assert.ok( false, 'everything\'s gonna be alright' );
 
 		} );

+ 68 - 0
test/unit/src/lights/LightProbe.tests.js

@@ -0,0 +1,68 @@
+/* global QUnit */
+
+import { LightProbe } from '../../../../src/lights/LightProbe.js';
+
+import { Light } from '../../../../src/lights/Light.js';
+
+export default QUnit.module( 'Lights', () => {
+
+	QUnit.module( 'LightProbe', () => {
+
+		// INHERITANCE
+		QUnit.test( 'Extending', ( assert ) => {
+
+			const object = new LightProbe();
+			assert.strictEqual(
+				object instanceof Light, true,
+				'LightProbe extends from Light'
+			);
+
+		} );
+
+		// INSTANCING
+		QUnit.todo( 'Instancing', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		// PROPERTIES
+		QUnit.todo( 'sh', ( assert ) => {
+
+			// SphericalHarmonics3 if not supplied
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		// PUBLIC
+		QUnit.test( 'isLightProbe', ( assert ) => {
+
+			const object = new LightProbe();
+			assert.ok(
+				object.isLightProbe,
+				'LightProbe.isLightProbe should be true'
+			);
+
+		} );
+
+		QUnit.todo( 'copy', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		QUnit.todo( 'fromJSON', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		QUnit.todo( 'toJSON', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+	} );
+
+} );

+ 126 - 11
test/unit/src/lights/LightShadow.tests.js

@@ -14,16 +14,137 @@ export default QUnit.module( 'Lights', () => {
 
 		} );
 
-		// PUBLIC STUFF
+		// PROPERTIES
+		QUnit.todo( 'camera', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		QUnit.todo( 'bias', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		QUnit.todo( 'normalBias', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		QUnit.todo( 'radius', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		QUnit.todo( 'blurSamples', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		QUnit.todo( 'mapSize', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		QUnit.todo( 'map', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		QUnit.todo( 'mapPass', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		QUnit.todo( 'matrix', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		QUnit.todo( 'autoUpdate', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		QUnit.todo( 'needsUpdate', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		// PUBLIC
+		QUnit.todo( 'getViewportCount', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		QUnit.todo( 'getFrustum', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		QUnit.todo( 'updateMatrices', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		QUnit.todo( 'getViewport', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		QUnit.todo( 'getFrameExtents', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		QUnit.todo( 'dispose', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		QUnit.todo( 'copy', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		QUnit.todo( 'clone', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		QUnit.todo( 'toJSON', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		// OTHERS
 		QUnit.test( 'clone/copy', ( assert ) => {
 
-			var a = new LightShadow( new OrthographicCamera( - 5, 5, 5, - 5, 0.5, 500 ) );
-			var b = new LightShadow( new OrthographicCamera( - 3, 3, 3, - 3, 0.3, 300 ) );
-			var c;
+			const a = new LightShadow( new OrthographicCamera( - 5, 5, 5, - 5, 0.5, 500 ) );
+			const b = new LightShadow( new OrthographicCamera( - 3, 3, 3, - 3, 0.3, 300 ) );
 
 			assert.notDeepEqual( a, b, 'Newly instanced shadows are not equal' );
 
-			c = a.clone();
+			const c = a.clone();
 			assert.smartEqual( a, c, 'Shadows are identical after clone()' );
 
 			c.mapSize.set( 256, 256 );
@@ -37,12 +158,6 @@ export default QUnit.module( 'Lights', () => {
 
 		} );
 
-		QUnit.todo( 'toJSON', ( assert ) => {
-
-			assert.ok( false, 'everything\'s gonna be alright' );
-
-		} );
-
 	} );
 
 } );

+ 52 - 8
test/unit/src/lights/PointLight.tests.js

@@ -1,13 +1,15 @@
 /* global QUnit */
 
-import { runStdLightTests } from '../../utils/qunit-utils.js';
 import { PointLight } from '../../../../src/lights/PointLight.js';
 
+import { Light } from '../../../../src/lights/Light.js';
+import { runStdLightTests } from '../../utils/qunit-utils.js';
+
 export default QUnit.module( 'Lights', () => {
 
 	QUnit.module( 'PointLight', ( hooks ) => {
 
-		var lights = undefined;
+		let lights = undefined;
 		hooks.beforeEach( function () {
 
 			const parameters = {
@@ -28,9 +30,13 @@ export default QUnit.module( 'Lights', () => {
 		} );
 
 		// INHERITANCE
-		QUnit.todo( 'Extending', ( assert ) => {
+		QUnit.test( 'Extending', ( assert ) => {
 
-			assert.ok( false, 'everything\'s gonna be alright' );
+			const object = new PointLight();
+			assert.strictEqual(
+				object instanceof Light, true,
+				'PointLight extends from Light'
+			);
 
 		} );
 
@@ -42,9 +48,37 @@ export default QUnit.module( 'Lights', () => {
 		} );
 
 		// PROPERTIES
+		QUnit.test( 'type', ( assert ) => {
+
+			const object = new PointLight();
+			assert.ok(
+				object.type === 'PointLight',
+				'PointLight.type should be PointLight'
+			);
+
+		} );
+
+		QUnit.todo( 'distance', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		QUnit.todo( 'decay', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		QUnit.todo( 'shadow', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
 		QUnit.test( 'power', ( assert ) => {
 
-			var a = new PointLight( 0xaaaaaa );
+			const a = new PointLight( 0xaaaaaa );
 
 			a.intensity = 100;
 			assert.numEqual( a.power, 100 * Math.PI * 4, 'Correct power for an intensity of 100' );
@@ -57,9 +91,20 @@ export default QUnit.module( 'Lights', () => {
 
 		} );
 
-		// PUBLIC STUFF
-		QUnit.todo( 'isPointLight', ( assert ) => {
+		// PUBLIC
+		QUnit.test( 'isPointLight', ( assert ) => {
 
+			const object = new PointLight();
+			assert.ok(
+				object.isPointLight,
+				'PointLight.isPointLight should be true'
+			);
+
+		} );
+
+		QUnit.todo( 'dispose', ( assert ) => {
+
+			// ensure calls dispose() on shadow
 			assert.ok( false, 'everything\'s gonna be alright' );
 
 		} );
@@ -77,7 +122,6 @@ export default QUnit.module( 'Lights', () => {
 
 		} );
 
-
 	} );
 
 } );

+ 48 - 0
test/unit/src/lights/PointLightShadow.tests.js

@@ -0,0 +1,48 @@
+/* global QUnit */
+
+import { PointLightShadow } from '../../../../src/lights/PointLightShadow.js';
+
+import { LightShadow } from '../../../../src/lights/LightShadow.js';
+
+export default QUnit.module( 'Lights', () => {
+
+	QUnit.module( 'PointLightShadow', () => {
+
+		// INHERITANCE
+		QUnit.test( 'Extending', ( assert ) => {
+
+			const object = new PointLightShadow();
+			assert.strictEqual(
+				object instanceof LightShadow, true,
+				'PointLightShadow extends from LightShadow'
+			);
+
+		} );
+
+		// INSTANCING
+		QUnit.todo( 'Instancing', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		// PUBLIC
+		QUnit.test( 'isPointLightShadow', ( assert ) => {
+
+			const object = new PointLightShadow();
+			assert.ok(
+				object.isPointLightShadow,
+				'PointLightShadow.isPointLightShadow should be true'
+			);
+
+		} );
+
+		QUnit.todo( 'updateMatrices', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+	} );
+
+} );

+ 62 - 6
test/unit/src/lights/RectAreaLight.tests.js

@@ -1,13 +1,15 @@
 /* global QUnit */
 
-import { runStdLightTests } from '../../utils/qunit-utils.js';
 import { RectAreaLight } from '../../../../src/lights/RectAreaLight.js';
 
+import { Light } from '../../../../src/lights/Light.js';
+import { runStdLightTests } from '../../utils/qunit-utils.js';
+
 export default QUnit.module( 'Lights', () => {
 
 	QUnit.module( 'RectAreaLight', ( hooks ) => {
 
-		var lights = undefined;
+		let lights = undefined;
 		hooks.beforeEach( function () {
 
 			const parameters = {
@@ -27,9 +29,13 @@ export default QUnit.module( 'Lights', () => {
 		} );
 
 		// INHERITANCE
-		QUnit.todo( 'Extending', ( assert ) => {
+		QUnit.test( 'Extending', ( assert ) => {
 
-			assert.ok( false, 'everything\'s gonna be alright' );
+			const object = new RectAreaLight();
+			assert.strictEqual(
+				object instanceof Light, true,
+				'RectAreaLight extends from Light'
+			);
 
 		} );
 
@@ -40,13 +46,63 @@ export default QUnit.module( 'Lights', () => {
 
 		} );
 
-		// PUBLIC STUFF
-		QUnit.todo( 'isRectAreaLight', ( assert ) => {
+		// PROPERTIES
+		QUnit.test( 'type', ( assert ) => {
+
+			const object = new RectAreaLight();
+			assert.ok(
+				object.type === 'RectAreaLight',
+				'RectAreaLight.type should be RectAreaLight'
+			);
+
+		} );
+
+		QUnit.todo( 'width', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		QUnit.todo( 'height', ( assert ) => {
 
 			assert.ok( false, 'everything\'s gonna be alright' );
 
 		} );
 
+		QUnit.test( 'power', ( assert ) => {
+
+			const a = new RectAreaLight( 0xaaaaaa, 1, 10, 10 );
+			let actual = undefined;
+			let expected = undefined;
+
+			a.intensity = 100;
+			actual = a.power;
+			expected = 100 * a.width * a.height * Math.PI;
+			assert.numEqual( actual, expected, 'Correct power for an intensity of 100' );
+
+			a.intensity = 40;
+			actual = a.power;
+			expected = 40 * a.width * a.height * Math.PI;
+			assert.numEqual( actual, expected, 'Correct power for an intensity of 40' );
+
+			a.power = 100;
+			actual = a.intensity;
+			expected = 100 / ( a.width * a.height * Math.PI );
+			assert.numEqual( actual, expected, 'Correct intensity for a power of 100' );
+
+		} );
+
+		// PUBLIC
+		QUnit.test( 'isRectAreaLight', ( assert ) => {
+
+			const object = new RectAreaLight();
+			assert.ok(
+				object.isRectAreaLight,
+				'RectAreaLight.isRectAreaLight should be true'
+			);
+
+		} );
+
 		QUnit.todo( 'copy', ( assert ) => {
 
 			assert.ok( false, 'everything\'s gonna be alright' );

+ 82 - 9
test/unit/src/lights/SpotLight.tests.js

@@ -1,13 +1,15 @@
 /* global QUnit */
 
-import { runStdLightTests } from '../../utils/qunit-utils.js';
 import { SpotLight } from '../../../../src/lights/SpotLight.js';
 
+import { Light } from '../../../../src/lights/Light.js';
+import { runStdLightTests } from '../../utils/qunit-utils.js';
+
 export default QUnit.module( 'Lights', () => {
 
 	QUnit.module( 'SpotLight', ( hooks ) => {
 
-		var lights = undefined;
+		let lights = undefined;
 		hooks.beforeEach( function () {
 
 			const parameters = {
@@ -31,9 +33,13 @@ export default QUnit.module( 'Lights', () => {
 		} );
 
 		// INHERITANCE
-		QUnit.todo( 'Extending', ( assert ) => {
+		QUnit.test( 'Extending', ( assert ) => {
 
-			assert.ok( false, 'everything\'s gonna be alright' );
+			const object = new SpotLight();
+			assert.strictEqual(
+				object instanceof Light, true,
+				'SpotLight extends from Light'
+			);
 
 		} );
 
@@ -45,9 +51,67 @@ export default QUnit.module( 'Lights', () => {
 		} );
 
 		// PROPERTIES
+		QUnit.test( 'type', ( assert ) => {
+
+			const object = new SpotLight();
+			assert.ok(
+				object.type === 'SpotLight',
+				'SpotLight.type should be SpotLight'
+			);
+
+		} );
+
+		QUnit.todo( 'position', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		QUnit.todo( 'target', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		QUnit.todo( 'distance', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		QUnit.todo( 'angle', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		QUnit.todo( 'penumbra', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		QUnit.todo( 'decay', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		QUnit.todo( 'map', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		QUnit.todo( 'shadow', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
 		QUnit.test( 'power', ( assert ) => {
 
-			var a = new SpotLight( 0xaaaaaa );
+			const a = new SpotLight( 0xaaaaaa );
 
 			a.intensity = 100;
 			assert.numEqual( a.power, 100 * Math.PI, 'Correct power for an intensity of 100' );
@@ -60,9 +124,20 @@ export default QUnit.module( 'Lights', () => {
 
 		} );
 
-		// PUBLIC STUFF
-		QUnit.todo( 'isSpotLight', ( assert ) => {
+		// PUBLIC
+		QUnit.test( 'isSpotLight', ( assert ) => {
 
+			const object = new SpotLight();
+			assert.ok(
+				object.isSpotLight,
+				'SpotLight.isSpotLight should be true'
+			);
+
+		} );
+
+		QUnit.todo( 'dispose', ( assert ) => {
+
+			// ensure calls dispose() on shadow
 			assert.ok( false, 'everything\'s gonna be alright' );
 
 		} );
@@ -80,8 +155,6 @@ export default QUnit.module( 'Lights', () => {
 
 		} );
 
-
-
 	} );
 
 } );

+ 31 - 9
test/unit/src/lights/SpotLightShadow.tests.js

@@ -1,6 +1,8 @@
 /* global QUnit */
 
 import { SpotLightShadow } from '../../../../src/lights/SpotLightShadow.js';
+
+import { LightShadow } from '../../../../src/lights/LightShadow.js';
 import { SpotLight } from '../../../../src/lights/SpotLight.js';
 import { ObjectLoader } from '../../../../src/loaders/ObjectLoader.js';
 
@@ -9,9 +11,13 @@ export default QUnit.module( 'Lights', () => {
 	QUnit.module( 'SpotLightShadow', () => {
 
 		// INHERITANCE
-		QUnit.todo( 'Extending', ( assert ) => {
+		QUnit.test( 'Extending', ( assert ) => {
 
-			assert.ok( false, 'everything\'s gonna be alright' );
+			const object = new SpotLightShadow();
+			assert.strictEqual(
+				object instanceof LightShadow, true,
+				'SpotLightShadow extends from LightShadow'
+			);
 
 		} );
 
@@ -22,14 +28,31 @@ export default QUnit.module( 'Lights', () => {
 
 		} );
 
-		// PUBLIC STUFF
-		QUnit.todo( 'isSpotLightShadow', ( assert ) => {
+		// PROPERTIES
+		QUnit.todo( 'focus', ( assert ) => {
+
+			assert.ok( false, 'everything\'s gonna be alright' );
+
+		} );
+
+		// PUBLIC
+		QUnit.test( 'isSpotLightShadow', ( assert ) => {
+
+			const object = new SpotLightShadow();
+			assert.ok(
+				object.isSpotLightShadow,
+				'SpotLightShadow.isSpotLightShadow should be true'
+			);
+
+		} );
+
+		QUnit.todo( 'updateMatrices', ( assert ) => {
 
 			assert.ok( false, 'everything\'s gonna be alright' );
 
 		} );
 
-		QUnit.todo( 'update', ( assert ) => {
+		QUnit.todo( 'copy', ( assert ) => {
 
 			assert.ok( false, 'everything\'s gonna be alright' );
 
@@ -38,13 +61,12 @@ export default QUnit.module( 'Lights', () => {
 		// OTHERS
 		QUnit.test( 'clone/copy', ( assert ) => {
 
-			var a = new SpotLightShadow();
-			var b = new SpotLightShadow();
-			var c;
+			const a = new SpotLightShadow();
+			const b = new SpotLightShadow();
 
 			assert.notDeepEqual( a, b, 'Newly instanced shadows are not equal' );
 
-			c = a.clone();
+			const c = a.clone();
 			assert.smartEqual( a, c, 'Shadows are identical after clone()' );
 
 			c.mapSize.set( 256, 256 );

+ 4 - 0
test/unit/three.source.unit.js

@@ -124,12 +124,16 @@ import './src/helpers/SpotLightHelper.tests.js';
 
 //src/lights
 import './src/lights/AmbientLight.tests.js';
+import './src/lights/AmbientLightProbe.tests.js';
 import './src/lights/DirectionalLight.tests.js';
 import './src/lights/DirectionalLightShadow.tests.js';
 import './src/lights/HemisphereLight.tests.js';
+import './src/lights/HemisphereLightProbe.tests.js';
 import './src/lights/Light.tests.js';
+import './src/lights/LightProbe.tests.js';
 import './src/lights/LightShadow.tests.js';
 import './src/lights/PointLight.tests.js';
+import './src/lights/PointLightShadow.tests.js';
 import './src/lights/RectAreaLight.tests.js';
 import './src/lights/SpotLight.tests.js';
 import './src/lights/SpotLightShadow.tests.js';