MobX, Axios, PropTypes, Jest, and Enzyme - sgml/signature GitHub Wiki
PropTypes are for validation, Enzyme is for emulation, Jest is for assertions
Update the key on a component method to force a re-render.
- https://github.com/facebook/react/blob/master/scripts/error-codes/codes.json
- https://reactjs.org/docs/error-decoder.html/?invariant=####
- https://github.com/facebook/react/blob/master/packages/react-dom/src/__tests__/ReactDOMComponent-test.js
- http://lefkowitz.me/2018/08/22/handle-react-native-crashes-with-componentdidcatch/
- https://dev.to/sarah_chima/error-boundaries-in-react-3eib
- https://github.com/mobxjs/mobx-react/issues/410
- https://github.com/mobxjs/mobx/issues/1316
- https://github.com/moroshko/react-autosuggest/issues/362
- https://test-utils.vuejs.org/guide/advanced/vuex
- https://github.com/posva/vuex-mock-store?tab=readme-ov-file#providing-custom-spies
- https://stackoverflow.com/questions/41150475/how-to-fake-being-offline-in-jasmine
- https://github.com/facebook/jest/issues/6798
- https://github.com/facebook/jest/issues/6798
- https://github.com/jasmine/jasmine/issues/299
- https://www.npmjs.com/package/react-is
- https://www.npmjs.com/package/react-visual-diff
- https://www.npmjs.com/package/react-source-render
- https://www.npmjs.com/package/react-angular-component
- https://raw.githubusercontent.com/facebook/react/master/packages/react-is/src/__tests__/ReactIs-test.js
- https://airbnb.io/enzyme/docs/api/ReactWrapper/exists.html
- https://github.com/mobxjs/mobx/wiki/Migrating-from-mobx-3-to-mobx-4
- https://github.com/mobxjs/mobx/blob/master/CHANGELOG.md
- https://github.com/facebook/jest/blob/master/CHANGELOG.md
- https://github.com/airbnb/enzyme/blob/master/CHANGELOG.md
- https://github.com/facebook/prop-types/blob/master/CHANGELOG.md
- https://medium.com/@cameronfletcher92/mobdux-combining-the-good-parts-of-mobx-and-redux-61bac90ee448
- https://hackernoon.com/introduction-to-redux-and-mobx-e6fa98b6479
- https://github.com/sapegin/jest-cheat-sheet
- https://reactjs.org/blog/2018/10/23/react-v-16-6.html
- https://reactjs.org/docs/hooks-faq.html
- https://hackernoon.com/the-react-state-museum-a278c726315
- https://github.com/mobxjs/mobx-react-lite
- https://medium.com/@paulanthonysalvatore/jest-my-summer-approaching-various-problems-with-jest-enzyme-fc1ad992aece
- https://engineering.classdojo.com/blog/2017/01/12/integration-testing-react-redux/
- https://github.com/airbnb/enzyme/blob/master/docs/guides/jsdom.md
- https://stackoverflow.com/questions/25472665/watch-and-rerun-jest-js-tests
- https://stackoverflow.com/questions/49576635/how-to-wait-in-enzyme-for-a-promise-from-a-private-function
- https://github.com/airbnb/enzyme/issues/1213
- https://github.com/WebReflection/redefine
- https://medium.com/@juanlizarazo/how-to-spy-on-a-property-getter-or-setter-with-jasmine-ad06c00ba612
- https://github.com/facebook/jest/issues/2227
- https://stackoverflow.com/questions/14047809/js-defineproperty-and-prototype
- https://dmitripavlutin.com/catch-the-xmlhttp-request-in-plain-javascript/
- https://medium.com/@gilfink/quick-tip-creating-an-xmlhttprequest-interceptor-1da23cf90b76
- https://medium.com/@matthew.holman/testing-url-hash-query-with-jest-8165f26ab94e
- https://github.com/kentcdodds/react-testing-library/issues/93
- https://stackoverflow.com/questions/43697455/how-to-mock-replace-getter-function-of-object-with-jest
- https://github.com/airbnb/enzyme/issues/1468
- https://stackoverflow.com/questions/46169824/intercept-navigation-change-with-jest-js-or-how-to-override-and-restore-locatio
- https://blog.npmjs.org/post/127671403050/testing-and-deploying-with-ordered-npm-run-scripts
- https://appendto.com/2018/09/25-public-react-repos-apps-to-inspire-your-next-project-part-2/
- https://open.nytimes.com/the-future-of-meta-tag-management-for-modern-react-development-ec26a7dc9183?gi=a12af8fa545f
- https://elijahmanor.com/react-devtools-profiler/
- https://maksimivanov.com/posts/react-native-mobx-tutorial/
- https://philhosoft.github.io/Programming/AngularJS-1-and-MobX-2/
- https://engineering.huiseoul.com/7-tips-of-using-mobx-6ca8c35071dc
- https://appendto.com/2018/09/geocoding-with-google-sheets-importjson/
- http://www.deadcoderising.com/react-16-render-a-child-component-into-another-dom-node-using-portals/
- https://hackernoon.com/building-a-blockchain-dapp-using-truffle-react-next-js-and-mobx-part-2-847193b497e4
- https://medium.com/react-native-training/ditching-setstate-for-mobx-766c165e4578
- https://auth0.com/blog/managing-the-state-of-react-apps-with-mobx/
- https://github.com/taming-the-state-in-react/taming-the-state-in-react/blob/master/manuscript/06-mobx/00-mobx.md
- http://engineering.pivotal.io/post/tdd-mobx/
- https://github.com/gothinkster/react-mobx-realworld-example-app
- https://tech.small-improvements.com/how-to-migrate-an-angularjs-1-app-to-react/
- https://medium.com/hoopeez/the-deep-dive-migration-from-angular-to-react-ea5a807e95eb
- https://levelup.gitconnected.com/how-to-manage-state-in-ionic-2-apps-with-mobx-df659de6a8aa
- https://medium.com/hacking-talent/setstate-vs-mobx-1e81688b746
- https://www.codementor.io/petarvukasinovic/redux-vs-vuex-for-state-management-in-vue-js-n10yd7g2f
- https://medium.com/supercharges-mobile-product-guide/angular-redux-the-lesson-weve-learned-for-you-93bc94391958
- https://itnext.io/build-a-view-framework-free-data-layer-based-on-mobx-integration-with-vue-1-8b524b86c7b8
- https://codeburst.io/migrating-from-redux-to-mobx-state-tree-straight-to-the-steps-735ae20d6cd5
- https://goshakkk.name/controlled-vs-uncontrolled-inputs-react/
- https://www.robinwieruch.de/conditional-rendering-react/
- https://www.robinwieruch.de/mobx-react/
- https://appendto.com/2017/08/journey-vue-mobx/
- https://medium.com/@aravishack/react-js-hooks-suspense-lazy-memo-context-api-hoc-refs-2c0266761f59
- https://stackoverflow.com/questions/45947741/how-to-test-a-mobx-store-function-asynchronously-with-jest
- https://stackoverflow.com/questions/49623682/jest-framework-throwing-error-as-unexpected-identifier-for-jquery-import
- https://stackoverflow.com/questions/51261252/jest-unexpected-identifier-react
- https://stackoverflow.com/questions/53884561/jest-unit-test-function-returns-syntaxerror-unexpected-identifier-at-function
- https://stackoverflow.com/questions/28725955/how-do-i-test-a-single-file-using-jest
- https://jestjs.io/docs/en/mock-function-api
- https://medium.com/@deanslamajr/jest-fn-all-the-things-d26f3b929986
- https://stackoverflow.com/questions/51990121/how-to-test-in-jest-the-mediaquerlist-addlistener/52001808
- http://nicolerauch.de/posts/2016-05-16-shallow-rendering.html
- https://mateuszroth.pl/komp/article-react-jest-enzyme.php
- https://github.com/theodesp/todo-app-mobx
- https://github.com/airbnb/enzyme/blob/master/packages/enzyme-test-suite/test/ShallowWrapper-spec.jsx
- https://airbnb.io/enzyme/docs/api/ShallowWrapper/contains.html
- https://airbnb.io/enzyme/docs/api/shallow.html
- https://devhints.io/enzyme
- https://devhints.io/enzyme@2
- https://devhints.io/jest
- https://jestjs.io/docs/en/expect
- https://jestjs.io/docs/en/troubleshooting#tests-are-failing-and-you-don-t-know-why
- https://github.com/mobxjs/mobx-react/blob/master/test/propTypes.test.js
- https://www.ian-thomas.net/custom-proptype-validation-with-react/
- https://jaketrent.com/post/react-oneof-vs-oneoftype/
- https://www.javascriptstuff.com/validate-nested-proptypes/
- https://stackoverflow.com/questions/43073338/enzyme-method-text-is-only-meant-to-be-run-on-a-single-node-0-found-instead?rq=1
- https://github.com/jason0x43/intern-examples/blob/intern-4/react-enzyme-example/tests/unit/components/Header.js
- https://github.com/adriantoine/enzyme-to-json/issues/19
- https://github.com/facebook/jest/issues/2291
- https://github.com/airbnb/enzyme/issues/1683
- https://www.nearform.com/blog/avoiding-common-hurdles-in-unit-testing/
- https://github.com/mobxjs/mobx-react/blob/master/test/propTypes.test.js
- https://reactjs.org/blog/2015/12/18/react-components-elements-and-instances.html
- https://reactjs.org/docs/cross-origin-errors.html
- https://reactjs.org/docs/shallow-renderer.html
- https://discuss.reactjs.org/t/historic-reasons-behind-setstate-not-being-immediately-visible/8487
- https://discuss.reactjs.org/t/should-we-drop-immutable-records-for-flow/12122
- https://discuss.reactjs.org/t/constructor-props-and-super-props-vs-constructor-and-super/9036
- http://slides.com/johnlynch/reactjs#/28
- http://www.rigelgroupllc.com/blog/2014/01/04/reactjs-roundup/
- https://stackoverflow.com/questions/39067004/monkey-patching-react-components
- https://reactjs.org/blog/2018/05/23/react-v-16-4.html
- https://github.com/facebook/react/blob/master/CHANGELOG.md
- https://kruschecompany.com/blog/post/whats-new-in-react-16.3
- https://cmichel.io/react-just-got-ugly-with-16-4-update/
- https://dev.to/andrewusher17/react-164-experimental-profiler-what-is-it-4nfe
- https://reactjs.org/blog/2018/06/07/you-probably-dont-need-derived-state.html
- https://css-tricks.com/render-children-in-react-using-fragment-or-array-components/
- https://philhosoft.github.io/Programming/AngularJS-1-and-MobX-2/
- https://stackoverflow.com/questions/39036605/mobx-async-reaction
- https://www.leighhalliday.com/mobx-async-actions
- https://mobx.js.org/best/actions.html
- https://github.com/mobxjs/mobx/blob/master/src/api/when.ts
- https://github.com/mobxjs/mobx/blob/master/test/base/intercept.js
- https://github.com/mobxjs/mobx/blob/master/test/base/map.js
- https://medium.com/@mweststrate/mobx-2-2-explicit-actions-controlled-mutations-and-improved-dx-45cdc73c7c8d
- https://www.sitepoint.com/manage-javascript-application-state-mobx/
- https://medium.com/@trekinbami/observe-changes-in-dynamically-keyed-objects-with-mobx-and-react-24b4f857bae9
- https://alexhisen.gitbooks.io/mobx-recipes/content/use-observables-instead-of-state-in-react-components.html
- https://blog.risingstack.com/handling-react-forms-with-mobx-observables/
- https://itnext.io/react-with-out-mobx-part-1-of-2-b540a7e631a9
- https://engineering.huiseoul.com/7-tips-of-using-mobx-6ca8c35071dc?gi=264ae55aa498
- https://mobx.js.org/refguide/api.html#enforceactions
- https://github.com/softonic/axios-retry
- https://codereviewvideos.com/blog/7-things-i-learned-adding-jest-existing-project/
- https://www.leighhalliday.com/testing-asynchronous-components-mocks-jest
- https://github.com/axios/axios/blob/master/test/specs/options.spec.js
- https://github.com/nuxt-community/axios-module/blob/master/docs/extend.md
- https://kapeli.com/cheat_sheets/Axios.docset/Contents/Resources/Documents/index
- https://medium.com/swlh/handling-access-and-refresh-tokens-using-axios-interceptors-3970b601a5da
- https://www.sitepoint.com/axios-beginner-guide/
- https://axios.nuxtjs.org/options.html#headers
- https://axios.nuxtjs.org/extend.html
- https://github.com/facebook/jest/blob/master/docs/SnapshotTesting.md
- https://btholt.github.io/complete-intro-to-react-v2/2016/01/11/react-testing.html
- https://medium.com/@luisvieira_gmr/snapshot-testing-react-components-with-jest-best-practices-dd1585b2b93d
- https://www.jstwister.com/post/jest-snapshot-testing-with-enzyme/
- https://www.slideshare.net/ronalfy/introduction-to-react-for-jquery-developers-75536302
- https://dev.to/vonheikemen/creating-react-components-using-only-es5-features-52a1
- http://www.jstips.co/en/react/
- https://blog.jfo.click/how-react-do/
- https://blog.scalac.io/2015/04/02/clojurescript-reactjs-reagent.html
- https://www.slideshare.net/ronalfy/introduction-to-react-for-jquery-developers-75536302
// Foo.vue
<template>
<div>
<Bar />
</div>
</template>
<script>
import Bar from './Bar.vue';
export default {
components: {
Bar
}
};
</script>
// Bar.vue
<template>
<span>Content</span>
</template>
<script>
export default {
name: 'Bar'
};
</script>
// Foo.spec.js
import { shallowMount } from '@vue/test-utils';
import Foo from '@/components/Foo.vue';
import Bar from '@/components/Bar.vue';
describe('Foo.vue', () => {
it('renders a div with a nested span', () => {
const wrapper = shallowMount(Foo, {
stubs: {
Bar
}
});
expect(wrapper.find('div').exists()).toBe(true);
expect(wrapper.find('div span').exists()).toBe(true);
});
});
test: description: "renders a div with a nested span" setup: component: "Foo" stubs: - "Bar" assertions: - find: "div" exists: true - find: "div span" exists: true