tests/qunit: Change assert.ok to assert.true

Avoid loose assertion

Change-Id: I6fd398ef2608c836fd59e0a48271f11c5e0d78a9
This commit is contained in:
Umherirrender 2023-03-31 20:37:25 +02:00
parent 082a59b991
commit 1a4bd424b4
2 changed files with 6 additions and 6 deletions

View file

@ -19,7 +19,7 @@
model = new CardModel( {} );
model.on( 'change', function () {
assert.ok( false, 'It doesn\'t emit an event when silenced.' );
assert.true( false, 'It doesn\'t emit an event when silenced.' );
} );
model.set( 'foo', 'bar', true );

View file

@ -32,7 +32,7 @@
this.sandbox.stub( this.api, 'get' ).returns( $.Deferred().resolve( relatedPages ) );
return gateway.getForCurrentPage( 1 ).then( function ( results ) {
assert.ok( Array.isArray( results ), 'Results must be an array' );
assert.true( Array.isArray( results ), 'Results must be an array' );
assert.strictEqual( results[ 0 ].title, 'Oh noes' );
} );
} );
@ -42,7 +42,7 @@
this.sandbox.stub( this.api, 'get' ).returns( $.Deferred().resolve( emptyRelatedPages ) );
return gateway.getForCurrentPage( 1 ).then( function ( results ) {
assert.ok( Array.isArray( results ), 'Results must be an array' );
assert.true( Array.isArray( results ), 'Results must be an array' );
assert.strictEqual( results.length, 0 );
} );
} );
@ -52,8 +52,8 @@
spy = this.sandbox.stub( this.api, 'get' ).returns( $.Deferred().resolve( relatedPages ) );
return gateway.getForCurrentPage( 1 ).then( function ( results ) {
assert.ok( Array.isArray( results ), 'Results must be an array' );
assert.notOk( spy.called, 'API is not invoked' );
assert.true( Array.isArray( results ), 'Results must be an array' );
assert.false( spy.called, 'API is not invoked' );
assert.strictEqual( results.length, 0 );
} );
} );
@ -97,7 +97,7 @@
.returns( $.Deferred().resolve( relatedPages ) );
return gateway.getForCurrentPage( 1 ).then( function ( results ) {
assert.ok( Array.isArray( results ), 'Results must be an array' );
assert.true( Array.isArray( results ), 'Results must be an array' );
assert.strictEqual( results.length, 1, 'API is invoked to source articles.' );
} );
} );