Skip to content

Commit

Permalink
fix tsconfig to be strict in test
Browse files Browse the repository at this point in the history
  • Loading branch information
merisbahti committed Sep 20, 2020
1 parent fab011c commit 2a427cf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 3 additions & 1 deletion test/focus-lens.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import React from 'react'
import * as rtl from '@testing-library/react'
import { focus } from '../src/index'

const succ = (input: number) => input + 1

it('focus on an atom works', async () => {
const bigAtom = atom({ a: 0 })
const aAtom = focus(bigAtom, optic => optic.prop('a'))
Expand All @@ -14,7 +16,7 @@ it('focus on an atom works', async () => {
<>
<div>bigAtom: {JSON.stringify(bigAtomValue)}</div>
<div>count: {count}</div>
<button onClick={() => setCount(c => c + 1)}>button</button>
<button onClick={() => setCount(succ)}>button</button>
</>
)
}
Expand Down
2 changes: 1 addition & 1 deletion test/focus-prism.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as rtl from '@testing-library/react'
import { focus } from '../src/index'

it('updates prisms', async () => {
const bigAtom = atom<{ a: number | undefined }>({ a: 5 })
const bigAtom = atom<{ a?: number }>({ a: 5 })
const aAtom = focus(bigAtom, optic => optic.prop('a').optional())

const Counter: React.FC = () => {
Expand Down
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
{
"include": ["src", "types"],
"include": ["src", "types", "test"],
"compilerOptions": {
"module": "esnext",
"lib": ["dom", "esnext"],
"importHelpers": true,
"declaration": true,
"sourceMap": true,
"rootDir": "./src",
"strict": true,
"strictNullChecks": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
Expand Down

0 comments on commit 2a427cf

Please sign in to comment.