 							.catch(reject)
 					.finally(logs.unsubscribe)
 				.then (lines) ->
-					m.chai.expect(lines).to.have.lengthOf(2)
 					m.chai.expect(lines).to.deep.match [{
 						message: 'Existing message'
 					}, {
 						message: 'New message'
 					}]
+					m.chai.expect(lines).to.have.lengthOf(2)
 
 			it 'should allow unsubscribing from logs', ->
 				balena.logs.subscribe(@uuid)

							resolve(lines)
					.finally(logs.unsubscribe)
				.then (lines) ->
					m.chai.expect(lines).to.have.lengthOf(2)
					m.chai.expect(lines).to.deep.match [{
						message: 'Old message'
					}, {
						message: 'Slightly newer message'
					}]

			it 'should limit historical logs by count', ->
				sendLogMessages @uuid, @deviceApiKey, [{

							resolve(lines)
					.finally(logs.unsubscribe)
				.then (lines) ->
					m.chai.expect(lines).to.deep.match [{
						message: 'Slightly newer message'
					}]
					m.chai.expect(lines).to.have.lengthOf(1)

			it 'should stream new logs after historical logs', ->
				sendLogMessages @uuid, @deviceApiKey, [{
