Flow can't find 'chai' export expect()/assert()/should()
See original GitHub issue@samwgoldman if I leverage chai using the customary import for ‘expect’:
import { expect } from 'chai';
Flow(v0.35.0) carps:
/reusable/utilities/foo.spec.js:14
14: import { expect } from 'chai';
^^^^^^ Named import from module `chai`. This module has no named export called `expect`.
I am leveraging your flow-typed/definitions/npm/chai_v3.5.x/flow_v0.24.0-/chai_v3.5.x.js.
Do I need to add something to that declaration to expose ‘expect’ or import ‘expect’ differently?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top Results From Across the Web
how to assert in my tests that a Chai assertion will fail (Error vs ...
The reason is by doing import {AssertionError} from ... it is actually looking for an exported property of the package 'assertion-error', ...
Read more >Expect / Should - Chai Assertion Library
Chai is a BDD / TDD assertion library for [node](http://nodejs.org) and the browser that can be delightfully paired with any javascript testing framework....
Read more >chaijs/chai - Gitter
Hello , I register the chai module in my wdio.conf.js file require('chai/register-assert');. In my test file I write: assert.equal(...); assert.include(.
Read more >chaijs/chai.js - chromium/src/third_party - Git at Google
the assertion `expect(numKittens).to.equal(7);`, the `object` flag will. * contain `numKittens` so that the ... expect(function () {}).to.not.throw();.
Read more >Mocha - the fun, simple, flexible JavaScript test framework
chai - expect() , assert() and should -style assertions; better-assert - C-style self-documenting assert(); unexpected - “the extensible BDD assertion toolkit” ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m running into this issue as well, with the same flow-typed definition. We’re using Flow 0.46. Anyone else seeing it?
Hi, I’ve just hit the same bug today.
I’ve pushed a branch of a project that exposes it : https://github.com/flegall/monorepo-fullstack-starter/tree/flowtype_482
What’s strange is that only the expect function has this problem in my case. I’m using Jest with Chai Assertions. I’ve noticed that the behaviour doesn’t appear any more when removing the jest definition file (which exposes a global expect method).