Skip to content

Commit

Permalink
fix(app): lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jankapunkt committed Jan 4, 2024
1 parent e582161 commit 8814789
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 1,166 deletions.
5 changes: 3 additions & 2 deletions app/__mocks__/@react-native-async-storage/async-storage.js
@@ -1,2 +1,3 @@
// eslint-disable-next-line
export default from '@react-native-async-storage/async-storage/jest/async-storage-mock'
// eslint-disable
import AsyncStorage from '@react-native-async-storage/async-storage/jest/async-storage-mock'
export default AsyncStorage
8 changes: 4 additions & 4 deletions app/__testHelpers__/expectThrowAsync.js
@@ -1,3 +1,5 @@
/* eslint-env jest */

/**
* Test helper to test async functions to throw
* expected errors
Expand All @@ -9,12 +11,10 @@ export const expectThrowAsync = async ({ fn, message }) => {
let catched = false
try {
await fn()
}
catch (e) {
} catch (e) {
expect(e.message).toEqual(message)
catched = true
}
finally {
} finally {
expect(catched).toEqual(true)
}
}
3 changes: 1 addition & 2 deletions app/__testHelpers__/stub.js
Expand Up @@ -9,8 +9,7 @@ export const stub = (target, name, handler) => {
const stubbedTarget = sinon.stub(target, name)
if (typeof handler === 'function') {
stubbedTarget.callsFake(handler)
}
else {
} else {
stubbedTarget.value(handler)
}
stubs.set(stubbedTarget, name)
Expand Down
3 changes: 2 additions & 1 deletion app/__tests__/components/ErrorMessage.test.js
@@ -1,3 +1,4 @@
/* eslint-env jest */
import React from 'react'
import TestRenderer from 'react-test-renderer'
import { ErrorMessage } from '../../src/components/ErrorMessage'
Expand All @@ -13,4 +14,4 @@ describe('ErrorMessage', function () {
const testInstance = testRenderer.root
expect(testInstance.findByType(Text).props.children).toBe(error.message)
})
})
})
1 change: 1 addition & 0 deletions app/jestSetup.js
@@ -1,3 +1,4 @@
/* global jest */
jest.mock('@react-native-async-storage/async-storage', () =>
require('@react-native-async-storage/async-storage/jest/async-storage-mock')
)

0 comments on commit 8814789

Please sign in to comment.