-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rip out sinon, mocha, and jsdom dependencies #159
Conversation
3d40176
to
9c1493a
Compare
it('calls componentDidMount', () => { | ||
spy(Foo.prototype, 'componentDidMount'); | ||
const wrapper = mount(<Foo />); | ||
expect(Foo.prototype.componentDidMount.calledOnce).to.be.true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these examples shouldn't use the getter assertions - .to.equal(true)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true. I'm going to be rewriting these examples anyway :)
LGTM overall, pending the one comment - but before we merge this, we should cut a (hopefully) final release on the 1.x line with everything that's in master |
d8a2e82
to
d4adcaa
Compare
import { REACT013 } from '../version'; | ||
} from '../src/Debug'; | ||
import { mount } from '../src/'; | ||
import { describeWithDOM,itIf } from './_helpers'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: space should be added after comma
44a61ec
to
1105c81
Compare
@ljharb Made some documentation updates. PTAL. |
Main thing left is i'm going to add the referenced example repos in a special test script so we can be reactive regarding regressions in these environments |
1105c81
to
dc327ad
Compare
a9baeff
to
6fbd757
Compare
Update: Got the "Example" projects pulled in as dev-deps and running those tests is now part of CI. I just have to add in the other projects (only mocha and karma are included ATM) |
- "0.10" | ||
before_install: | ||
- 'if [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then case "$(npm --version)" in 1.*) npm install -g npm@1.4.28 ;; 2.*) npm install -g npm@2 ;; esac ; fi' | ||
- 'if [ "${TRAVIS_NODE_VERSION}" != "0.6" ] && [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then npm install -g npm; fi' | ||
before_script: "sh install-relevant-react.sh" | ||
script: | ||
- 'if [ "${TRAVIS_NODE_VERSION}" = "4.2" ]; then npm run lint && npm run travis ; elif [ "${TRAVIS_NODE_VERSION}" = "0.12" ]; then npm run travis ; else npm test ; fi' | ||
- 'if [ -z "$REACT" ] && [ "${TRAVIS_NODE_VERSION}" = "4" ]; then npm run test:env -- "${EXAMPLE}" ; elif [ -z "$REACT" ]; then echo "Test Skipped" ; elif [ "${TRAVIS_NODE_VERSION}" = "4" ]; then npm run lint && npm run travis ; elif [ "${TRAVIS_NODE_VERSION}" = "0.12" ]; then npm run travis ; else npm test ; fi' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should also make sure npm test
locally runs all the npm run test:env
scripts so that devs don't miss them
0b5374a
to
05513d7
Compare
05513d7
to
26741a7
Compare
This refactor addresses several issues regarding enzyme working in a variety of environments, and the library just generally not making any assumptions about the environment that tests will be run in. For the most part, this amounts to: - remove direct dependency on jsdom - remove direct dependency on sinon - remove assumed dependency on mocha In addition to this, I would like to create several "example" projects that are some basic boilerplate to getting enzyme up and running with some combination of bundler/test runner/etc. These projects can end up being devDependencies to enzyme and we can run their tests as part of our tests, which will ensure that changes we make to enzyme will be compatible with environments we claim to support moving forward. Lastly, as a matter of organization, tests have been moved from `src/__tests__/*` to `tests/*`. Left to do for this to be mergable is: [ ] Add a "guides" section in the docs explaining how to use enzyme in different environments [ ] Add example projects as dev dependencies, include their tests in enzyme's test script
26741a7
to
219e50a
Compare
Rip out sinon, mocha, and jsdom dependencies
This refactor addresses several issues regarding enzyme working in a variety of environments, and
the library just generally not making any assumptions about the environment that tests will be
run in.
For the most part, this amounts to:
In addition to this, I would like to create several "example" projects that are some basic boilerplate
to getting enzyme up and running with some combination of bundler/test runner/etc. These projects
can end up being devDependencies to enzyme and we can run their tests as part of our tests, which will
ensure that changes we make to enzyme will be compatible with environments we claim to support moving
forward.
Lastly, as a matter of organization, tests have been moved from
src/__tests__/*
totests/*
.Left to do for this to be mergable is:
[ ] Add a "guides" section in the docs explaining how to use enzyme in different environments
[ ] Add example projects as dev dependencies, include their tests in enzyme's test script
NOTE: This will be a semver-MAJOR change because of the removal of
describeWithDOM
andsinon
etc. The mainmount
,shallow
, andrender
APIs have no breaking changes.Fixes #132
Fixes #104
Fixes #80
Fixes #75
Fixes #73
Fixes #66
Fixes #55
Fixes #44