From 19c639d1fb289fd85a4718c61d07f1f8e06138cb Mon Sep 17 00:00:00 2001 From: MrChocolatine <47531779+MrChocolatine@users.noreply.github.com> Date: Fri, 3 Sep 2021 18:25:16 +0100 Subject: [PATCH] test: remove logical expressions from `assert` https://github.com/platinumazure/eslint-plugin-qunit/blob/v6.2.0/docs/rules/no-assert-logical-expression.md --- tests/unit/initializers/embedded-test.ts | 27 +++++++++++++++--------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/tests/unit/initializers/embedded-test.ts b/tests/unit/initializers/embedded-test.ts index eb3cada8..51bd7664 100644 --- a/tests/unit/initializers/embedded-test.ts +++ b/tests/unit/initializers/embedded-test.ts @@ -49,7 +49,7 @@ module('Unit | Initializer | embedded', function (hooks) { }) test('by default, it does not change the normal behaviour', async function (this: Context, assert) { - assert.expect(3) + assert.expect(4) await this.application.boot() @@ -65,14 +65,17 @@ module('Unit | Initializer | embedded', function (hooks) { 'An empty embedded config is registered' ) - assert.ok( - this.application._booted === true && this.application._readinessDeferrals === 0, + assert.true(this.application._booted, 'The app has booted') + + assert.strictEqual( + this.application._readinessDeferrals, + 0, 'No deferral has been added' ) }) test('without `delegateStart`, it does not change the normal behaviour', async function (this: Context, assert) { - assert.expect(3) + assert.expect(4) this.application.register('config:environment', { embedded: { @@ -94,8 +97,11 @@ module('Unit | Initializer | embedded', function (hooks) { 'An empty embedded config is registered' ) - assert.ok( - this.application._booted === true && this.application._readinessDeferrals === 0, + assert.true(this.application._booted, 'The app has booted') + + assert.strictEqual( + this.application._readinessDeferrals, + 0, 'No deferral has been added' ) }) @@ -124,7 +130,7 @@ module('Unit | Initializer | embedded', function (hooks) { }) test('with `delegateStart`, it defers the boot of the app', function (this: Context, assert) { - assert.expect(3) + assert.expect(4) this.application.register('config:environment', { embedded: { @@ -152,10 +158,11 @@ module('Unit | Initializer | embedded', function (hooks) { 'The embedded config is not registered until the app is started' ) - const { _booted, _readinessDeferrals } = this.application + assert.false(this.application._booted, 'The app has not booted') - assert.ok( - _booted === false && _readinessDeferrals === initialDeferrals + 1, + assert.strictEqual( + this.application._readinessDeferrals, + initialDeferrals + 1, 'A deferral has been added' ) })