fix(test): faulty .flowconfig
Before adoption: this commit came in with the history the project adopted, so no landing records it.
The .js.flow tests were not working, because of a faulty config file.
authored by aleclarson · committed by Alec Larson · parent a0bfaa6 · Browse files · 5 files·+10 added−108 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
5 files+10 added−108 removed
- tests:+9 added−99 removed
- other:+1 added−9 removed
Provenance
- Commit
e8fe4ba- Tree
45c7694- Author
aleclarson <alec.stanford.larson@gmail.com>- Committer
Alec Larson <alec.stanford.larson@gmail.com>- Parent
a0bfaa6
5 files changed+10 added−108 removed
added:__tests__/flow/.flowconfig+8 added
1+[include]2+../../dist3+4+[lints]5+untyped-import=error6+7+[options]8+suppress_comment= \\(.\\|\n\\)*\\$ExpectErrormodified:__tests__/flow/flow.js.flow+1 added-1 removed
4 unmodified lines5 produce as produce2,6 applyPatches,7 Patch,8 original9-} from "../../src/index.js"9+} from "../../dist/immer.js"10 11 setAutoFreeze(true)12 setUseProxies(true)13 120 unmodified linesdeleted:__tests__/flow/ts.ts-98 removed
1-import produce, {setAutoFreeze, setUseProxies, original} from "../../src/index"2-3-setAutoFreeze(true)4-setUseProxies(true)5-6-// we really don't want this code to actually execute..7-const result = produce({x: 3}, draft => {8- draft.x = 49-10- // $ExpectError11- console.log(draft.y)12-})13-14-console.log(result.x)15-16-const f2 = produce(draft => {})17-f2({x: 3})18-19-// $ExpectError20-setAutoFreeze(3)21-22-// $ExpectError23-console.log(result.y)24-25-// $ExpectError26-produce()27-28-// $ExpectError29-produce({x: 3})30-31-// $ExpectError32-produce({x: 3}, [])33-34-{35- // curried & initial arg36- const f = produce(37- (state, increment: number) => {38- state.x += increment39- },40- {x: 3}41- )42-43- // $ExpectError Too few arguments44- f({x: 5})45-46- // $ExpectError47- f({x: 5}, "test")48-49- f({x: 5}, 3)50-51- f(undefined, 3)52-}53-54-{55- // curried f & no initial arg56- const f2 = produce((state: {x: number}, increment: number) => {57- state.x += increment58- })59-60- f2({x: 5}, 3)61-62- // $ExpectError63- f2(undefined, 3)64-}65-66-{67- // Issue #12968- const handlers = {69- ["TEST"]: (draft: {}, {id, value}: {id: string; value: string}) => {70- draft[id] = {...draft[id], value}71- return draft72- }73- }74-75- const reducer = (state = {}, {type, payload}: any): any =>76- handlers[type]77- ? produce<any, any>(handlers[type])(state, payload)78- : state79-}80-81-produce({x: 3, z: {}}, draftState => {82- const a = draftState83-84- if (a) {85- a.x86- // $ExpectError87- a.y88- }89-})90-91-produce([1], draftState => {92- const a = original(draftState)93- if (a) {94- // $ExpectError95- const b: string = a[0]96- const c: number = a[0]97- }98-})deleted:.flowconfig-8 removed
1-[ignore]2-.*/node_modules3-4-[include]5-__tests__/flow6-7-[options]8-suppress_comment= \\(.\\|\n\\)*\\$ExpectErrormodified:package.json+1 added-1 removed
10 unmodified lines1112131415151617181964 unmodified lines10 unmodified lines "scripts": { "watch": "jest --watch", "test": "jest", "test:perf": "NODE_ENV=production yarn-or-npm build && cd __performance_tests__ && babel-node add-data.js && babel-node todo.js && babel-node incremental.js", "test:flow": "yarn-or-npm flow check", "test:flow": "yarn-or-npm flow check __tests__/flow", "test:dts": "tsc -p __tests__/tsconfig.json --noEmit", "coveralls": "jest --coverage && cat ./coverage/lcov.info | ./node_modules/.bin/coveralls && rm -rf ./coverage", "build": "rimraf dist/ && cross-env NODE_ENV=production rollup -c && cpx 'src/immer.{d.ts,js.flow}' dist -v" },64 unmodified lines