1
0
mirror of https://github.com/kremalicious/blowfish.git synced 2024-11-22 01:36:58 +01:00

coverage fixes

This commit is contained in:
Matthias Kretschmann 2020-02-25 16:57:39 +01:00
parent 46ab69905d
commit cf6157b434
Signed by: m
GPG Key ID: 606EEEF3C479A91F
3 changed files with 25 additions and 21 deletions

View File

@ -22,10 +22,8 @@ before_script:
script:
- npm test || travis_terminate 1
- npm run dist
after_script:
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
- npm run dist
branches:
except:

View File

@ -10,9 +10,25 @@ import Accounts from '../components/Home/Accounts'
import IconCog from '../images/cog.svg'
import styles from './index.module.css'
export default function Home() {
function MainContent() {
const { isLoading, error, needsConfig } = useContext(AppContext)
return needsConfig ? (
<Welcome />
) : error ? (
<div className={styles.error}>{error}</div>
) : isLoading ? (
<Spinner />
) : (
<>
<Total />
<Divider />
<Accounts />
</>
)
}
export default function Home() {
return (
<>
<main className={styles.main}>
@ -22,22 +38,10 @@ export default function Home() {
</a>
</Link>
{needsConfig ? (
<Welcome />
) : error ? (
<div className={styles.error}>{error}</div>
) : isLoading ? (
<Spinner />
) : (
<>
<Total />
<Divider />
<Accounts />
</>
)}
<MainContent />
</main>
<Ticker style={isLoading ? { opacity: 0 } : null} />
<Ticker />
</>
)
}

View File

@ -22,11 +22,13 @@ module.exports = {
setupFilesAfterEnv: ['<rootDir>/tests/setupTests.js'],
runner: '@jest-runner/electron',
testEnvironment: '@jest-runner/electron/environment',
coverageDirectory: '../../coverage/',
coverageDirectory: '<rootDir>/coverage/',
collectCoverage: true,
collectCoverageFrom: [
'<rootDir>/src/renderer/**/*.jsx',
'!<rootDir>/dist',
'<rootDir>/src/renderer/**/*.{js,jsx}',
'!<rootDir>/src/renderer/next.config.js',
'!<rootDir>/src/renderer/out/**/*',
'!<rootDir>/src/renderer/.next/**/*',
'!**/node_modules/**'
]
}