Fix line length linter warnings

This commit is contained in:
Julia Friesel
2018-07-13 07:20:52 +02:00
parent 7382bff0dd
commit b3467005e1
+53 -30
View File
@@ -13,15 +13,16 @@ function turnIntoCycleDayObject(value, fakeDate) {
describe('sympto', () => { describe('sympto', () => {
describe('detect temperature shift', () => { describe('detect temperature shift', () => {
describe('regular rule', () => { describe('regular rule', () => {
it('reports lower temperature status before shift', function () { it('reports lower temperature status before shift', () => {
const lowerTemps = [36.7, 36.57, 36.47, 36.49, 36.57] const lowerTemps = [36.7, 36.57, 36.47, 36.49, 36.57]
.map(turnIntoCycleDayObject) .map(turnIntoCycleDayObject)
const status = getTemperatureStatus(lowerTemps) const status = getTemperatureStatus(lowerTemps)
expect(status).to.eql({ detected: false }) expect(status).to.eql({ detected: false })
}) })
it('detects temperature shift correctly', function () { it('detects temperature shift correctly', () => {
const tempShift = [36.7, 36.57, 36.47, 36.49, 36.57, 36.62, 36.55, 36.8, 36.86, 36.8] const tempShift =
[36.7, 36.57, 36.47, 36.49, 36.57, 36.62, 36.55, 36.8, 36.86, 36.8]
.map(turnIntoCycleDayObject) .map(turnIntoCycleDayObject)
const status = getTemperatureStatus(tempShift) const status = getTemperatureStatus(tempShift)
expect(status).to.eql({ expect(status).to.eql({
@@ -39,29 +40,33 @@ describe('sympto', () => {
}) })
}) })
it('detects no temperature shift when there are no 6 low temps', function () { it('detects no temperature shift when there are no 6 low temps', () => {
const tempShift = [36.47, 36.49, 36.57, 36.62, 36.55, 36.8, 36.86, 36.8] const tempShift = [36.47, 36.49, 36.57, 36.62, 36.55, 36.8, 36.86, 36.8]
.map(turnIntoCycleDayObject) .map(turnIntoCycleDayObject)
const status = getTemperatureStatus(tempShift) const status = getTemperatureStatus(tempShift)
expect(status).to.eql({ detected: false }) expect(status).to.eql({ detected: false })
}) })
it('detects no temperature shift if the shift is not high enough', function () { it('detects no temperature shift if the shift is not high enough', () => {
const tempShift = [36.57, 36.7, 36.47, 36.49, 36.57, 36.62, 36.55, 36.8, 36.86, 36.8] const tempShift =
[36.57, 36.7, 36.47, 36.49, 36.57, 36.62, 36.55, 36.8, 36.86, 36.8]
.map(turnIntoCycleDayObject) .map(turnIntoCycleDayObject)
const status = getTemperatureStatus(tempShift) const status = getTemperatureStatus(tempShift)
expect(status).to.eql({ detected: false }) expect(status).to.eql({ detected: false })
}) })
it('detects missing temperature shift correctly', function () { it('detects missing temperature shift correctly', () => {
const noTempShift = [36.7, 36.57, 36.47, 36.49, 36.57, 36.62, 36.55, 36.8, 36.86, 36.77] const noTempShift =
[36.7, 36.57, 36.47, 36.49, 36.57, 36.62, 36.55, 36.8, 36.86, 36.77]
.map(turnIntoCycleDayObject) .map(turnIntoCycleDayObject)
const status = getTemperatureStatus(noTempShift) const status = getTemperatureStatus(noTempShift)
expect(status).to.eql({ detected: false }) expect(status).to.eql({ detected: false })
}) })
it('detects shift after an earlier one was invalid', function () { it('detects shift after an earlier one was invalid', () => {
const temps = [36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.6, 36.6, 36.4, 36.4, 36.7, 36.8, 36.9] const temps =
[36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.6, 36.6, 36.4, 36.4,
36.7, 36.8, 36.9]
.map(turnIntoCycleDayObject) .map(turnIntoCycleDayObject)
const status = getTemperatureStatus(temps) const status = getTemperatureStatus(temps)
@@ -80,8 +85,10 @@ describe('sympto', () => {
}) })
}) })
it('detects 2 consecutive invalid shifts', function () { it('detects 2 consecutive invalid shifts', () => {
const temps = [36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.6, 36.6, 36.4, 36.4, 36.6, 36.6, 36.7] const temps =
[36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.6, 36.6, 36.4, 36.4,
36.6, 36.6, 36.7]
.map(turnIntoCycleDayObject) .map(turnIntoCycleDayObject)
const status = getTemperatureStatus(temps) const status = getTemperatureStatus(temps)
@@ -90,8 +97,10 @@ describe('sympto', () => {
}) })
describe('1st exception rule', () => { describe('1st exception rule', () => {
it('detects temperature shift', function () { it('detects temperature shift', () => {
const firstException = [36.7, 36.57, 36.47, 36.49, 36.57, 36.62, 36.55, 36.8, 36.86, 36.77, 36.63] const firstException =
[36.7, 36.57, 36.47, 36.49, 36.57, 36.62, 36.55,
36.8, 36.86, 36.77, 36.63]
.map(turnIntoCycleDayObject) .map(turnIntoCycleDayObject)
const status = getTemperatureStatus(firstException) const status = getTemperatureStatus(firstException)
expect(status).to.eql({ expect(status).to.eql({
@@ -110,23 +119,28 @@ describe('sympto', () => {
}) })
}) })
it('detects missing temperature shift correctly', function () { it('detects missing temperature shift correctly', () => {
const firstExceptionNoShift = [36.7, 36.57, 36.47, 36.49, 36.57, 36.62, 36.55, 36.8, 36.86, 36.77, 36.57] const firstExceptionNoShift =
[36.7, 36.57, 36.47, 36.49, 36.57, 36.62, 36.55,
36.8, 36.86, 36.77, 36.57]
.map(turnIntoCycleDayObject) .map(turnIntoCycleDayObject)
const status = getTemperatureStatus(firstExceptionNoShift) const status = getTemperatureStatus(firstExceptionNoShift)
expect(status).to.eql({ detected: false }) expect(status).to.eql({ detected: false })
}) })
it('detects missing temperature shift with not enough high temps', function () { it('detects missing temperature shift with not enough high temps', () => {
const temps = [36.7, 36.57, 36.47, 36.49, 36.57, 36.62, 36.55, 36.8, 36.86, 36.77] const temps =
[36.7, 36.57, 36.47, 36.49, 36.57, 36.62, 36.55, 36.8, 36.86, 36.77]
.map(turnIntoCycleDayObject) .map(turnIntoCycleDayObject)
const status = getTemperatureStatus(temps) const status = getTemperatureStatus(temps)
expect(status).to.eql({ detected: false }) expect(status).to.eql({ detected: false })
}) })
it('detects shift after an earlier one was invalid', function () { it('detects shift after an earlier one was invalid', () => {
const temps = [36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.6, 36.6, 36.4, 36.4, 36.7, 36.7, 36.7, 36.7] const temps =
[36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.6, 36.6, 36.4, 36.4,
36.7, 36.7, 36.7, 36.7]
.map(turnIntoCycleDayObject) .map(turnIntoCycleDayObject)
const status = getTemperatureStatus(temps) const status = getTemperatureStatus(temps)
@@ -149,8 +163,10 @@ describe('sympto', () => {
}) })
describe('2nd exception rule', () => { describe('2nd exception rule', () => {
it('detects temperature shift with exception temp eql ltl', function () { it('detects temperature shift with exception temp eql ltl', () => {
const secondException = [36.7, 36.57, 36.47, 36.49, 36.57, 36.62, 36.55, 36.8, 36.86, 36.6, 36.8] const secondException =
[36.7, 36.57, 36.47, 36.49, 36.57, 36.62, 36.55,
36.8, 36.86, 36.6, 36.8]
.map(turnIntoCycleDayObject) .map(turnIntoCycleDayObject)
const status = getTemperatureStatus(secondException) const status = getTemperatureStatus(secondException)
expect(status).to.eql({ expect(status).to.eql({
@@ -169,8 +185,10 @@ describe('sympto', () => {
}) })
}) })
it('detects temperature shift with exception temp lower than ltl', function () { it('detects temperature shift with exception temp lower than ltl', () => {
const secondException = [36.7, 36.57, 36.47, 36.49, 36.57, 36.62, 36.55, 36.8, 36.86, 36.4, 36.8] const secondException =
[36.7, 36.57, 36.47, 36.49, 36.57, 36.62, 36.55,
36.8, 36.86, 36.4, 36.8]
.map(turnIntoCycleDayObject) .map(turnIntoCycleDayObject)
const status = getTemperatureStatus(secondException) const status = getTemperatureStatus(secondException)
expect(status).to.eql({ expect(status).to.eql({
@@ -190,22 +208,27 @@ describe('sympto', () => {
}) })
it('detects missing temperature shift correctly', function () { it('detects missing temperature shift correctly', () => {
const temps = [36.7, 36.57, 36.47, 36.49, 36.57, 36.62, 36.55, 36.8, 36.86, 36.4, 36.77, 36.77] const temps =
[36.7, 36.57, 36.47, 36.49, 36.57, 36.62, 36.55,
36.8, 36.86, 36.4, 36.77, 36.77]
.map(turnIntoCycleDayObject) .map(turnIntoCycleDayObject)
const status = getTemperatureStatus(temps) const status = getTemperatureStatus(temps)
expect(status).to.eql({ detected: false }) expect(status).to.eql({ detected: false })
}) })
it('detects missing temperature shift when not enough high temps', function () { it('detects missing temperature shift when not enough high temps', () => {
const temps = [36.7, 36.57, 36.47, 36.49, 36.57, 36.62, 36.55, 36.8, 36.86, 36.4] const temps =
[36.7, 36.57, 36.47, 36.49, 36.57, 36.62, 36.55, 36.8, 36.86, 36.4]
.map(turnIntoCycleDayObject) .map(turnIntoCycleDayObject)
const status = getTemperatureStatus(temps) const status = getTemperatureStatus(temps)
expect(status).to.eql({ detected: false }) expect(status).to.eql({ detected: false })
}) })
it('detects shift after an earlier one was invalid', function () { it('detects shift after an earlier one was invalid', () => {
const temps = [36.7, 36.57, 36.47, 36.49, 36.57, 36.62, 36.55, 36.8, 36.86, 36.4, 36.77, 36.9, 36.9, 36.86, 37.04] const temps =
[36.7, 36.57, 36.47, 36.49, 36.57, 36.62, 36.55, 36.8, 36.86, 36.4,
36.77, 36.9, 36.9, 36.86, 37.04]
.map(turnIntoCycleDayObject) .map(turnIntoCycleDayObject)
const status = getTemperatureStatus(temps) const status = getTemperatureStatus(temps)
expect(status).to.eql({ expect(status).to.eql({