Skip to content

Commit

Permalink
test: remove logical expressions from assert
Browse files Browse the repository at this point in the history
  • Loading branch information
MrChocolatine committed Sep 6, 2021
1 parent a4b04dc commit 19c639d
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions tests/unit/initializers/embedded-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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: {
Expand All @@ -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'
)
})
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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'
)
})
Expand Down

0 comments on commit 19c639d

Please sign in to comment.