123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- /**
- * @author simonThiele / https://github.com/simonThiele
- * @author TristanVALCKE / https://github.com/Itee
- */
- /* global QUnit */
- import { Clock } from '../../../../src/core/Clock';
- export default QUnit.module( 'Core', () => {
- QUnit.module.todo( 'Clock', () => {
- function mockPerformance() {
- self.performance = {
- deltaTime: 0,
- next: function ( delta ) {
- this.deltaTime += delta;
- },
- now: function () {
- return this.deltaTime;
- }
- };
- }
- // INSTANCING
- QUnit.test( "Instancing", ( assert ) => {
- assert.ok( false, "everything's gonna be alright" );
- } );
- // PUBLIC STUFF
- QUnit.test( "start", ( assert ) => {
- assert.ok( false, "everything's gonna be alright" );
- } );
- QUnit.test( "stop", ( assert ) => {
- assert.ok( false, "everything's gonna be alright" );
- } );
- QUnit.test( "getElapsedTime", ( assert ) => {
- assert.ok( false, "everything's gonna be alright" );
- } );
- QUnit.test( "getDelta", ( assert ) => {
- assert.ok( false, "everything's gonna be alright" );
- } );
- // OTHERS
- QUnit.test( "clock with performance", ( assert ) => {
- mockPerformance();
- var clock = new Clock( false );
- clock.start();
- self.performance.next( 123 );
- assert.numEqual( clock.getElapsedTime(), 0.123, "okay" );
- self.performance.next( 100 );
- assert.numEqual( clock.getElapsedTime(), 0.223, "okay" );
- clock.stop();
- self.performance.next( 1000 );
- assert.numEqual( clock.getElapsedTime(), 0.223, "don't update time if the clock was stopped" );
- } );
- } );
- } );
|