├── .circleci └── config.yml ├── .eslintrc.json ├── .gitignore ├── .nvmrc ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── karma.conf.js ├── package.json ├── rollup.config.js ├── src ├── context.js ├── index.js ├── mount.js ├── setup-app.js └── visit.js ├── tests ├── .eslintrc.json ├── index.js ├── mount-test.js ├── setup-app-test.js └── visit-test.js └── yarn.lock /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | references: 2 | defaults: &defaults 3 | working_directory: ~/react 4 | docker: 5 | - image: circleci/node:8-browsers 6 | 7 | cache_key: &cache_key 8 | react-v1-{{ .Branch }}-{{ checksum "yarn.lock" }} 9 | 10 | attach_workspace: &attach_workspace 11 | attach_workspace: 12 | at: ~/ 13 | 14 | version: 2.0 15 | jobs: 16 | install: 17 | <<: *defaults 18 | steps: 19 | - checkout 20 | - restore_cache: 21 | name: Restore cache 22 | key: *cache_key 23 | - run: 24 | name: Install dependencies 25 | command: yarn 26 | - save_cache: 27 | name: Save cache 28 | key: *cache_key 29 | paths: 30 | - node_modules 31 | - persist_to_workspace: 32 | root: ~/ 33 | paths: 34 | - react 35 | - .ssh 36 | 37 | lint: 38 | <<: *defaults 39 | steps: 40 | - *attach_workspace 41 | - run: 42 | name: Lint package 43 | command: yarn lint 44 | 45 | build: 46 | <<: *defaults 47 | steps: 48 | - *attach_workspace 49 | - run: 50 | name: Build documentation 51 | command: yarn docs 52 | - run: 53 | name: Build package 54 | command: yarn build 55 | - persist_to_workspace: 56 | root: ~/ 57 | paths: 58 | - react/dist 59 | - react/docs 60 | 61 | test: 62 | <<: *defaults 63 | steps: 64 | - *attach_workspace 65 | - run: 66 | name: Run tests 67 | command: yarn test 68 | 69 | deploy: 70 | <<: *defaults 71 | steps: 72 | - *attach_workspace 73 | - run: 74 | name: Publish to NPM 75 | command: | 76 | echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc 77 | npx bigtest-release --access=public 78 | - run: 79 | name: Push Tags 80 | command: git push --tags 81 | 82 | workflows: 83 | version: 2 84 | default: 85 | jobs: 86 | - install 87 | - lint: 88 | requires: 89 | - install 90 | - build: 91 | requires: 92 | - install 93 | - test: 94 | requires: 95 | - install 96 | - deploy: 97 | requires: 98 | - lint 99 | - build 100 | - test 101 | filters: 102 | branches: 103 | only: master 104 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "parser": "babel-eslint", 3 | "extends": [ 4 | "standard", 5 | "plugin:react/recommended" 6 | ], 7 | "rules": { 8 | "semi": ["error", "always"], 9 | "space-before-function-paren": ["error", { 10 | "anonymous": "never", 11 | "named": "never", 12 | "asyncArrow": "always" 13 | }], 14 | "indent": ["error", 2] 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /node_modules 3 | /dist 4 | /docs 5 | *.log 6 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | 8 2 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | All notable changes to this project will be documented in this file. 3 | 4 | The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) 5 | 6 | ## [Unreleased] 7 | 8 | ## [0.1.2] - 2018-06-20 9 | 10 | ### Fixed 11 | 12 | - exception documentation 13 | 14 | ## [0.1.1] - 2018-05-30 15 | 16 | ### Fixed 17 | 18 | - README typos 19 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | * Using welcoming and inclusive language 12 | * Being respectful of differing viewpoints and experiences 13 | * Gracefully accepting constructive criticism 14 | * Focusing on what is best for the community 15 | * Showing empathy towards other community members 16 | 17 | Examples of unacceptable behavior by participants include: 18 | 19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances 20 | * Trolling, insulting/derogatory comments, and personal or political attacks 21 | * Public or private harassment 22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission 23 | * Other conduct which could reasonably be considered inappropriate in a professional setting 24 | 25 | ## Our Responsibilities 26 | 27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 28 | 29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | ## Scope 32 | 33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 34 | 35 | ## Enforcement 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at oss@frontside.io. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 38 | 39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 40 | 41 | ## Attribution 42 | 43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] 44 | 45 | [homepage]: http://contributor-covenant.org 46 | [version]: http://contributor-covenant.org/version/1/4/ 47 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 BigTest 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # :warning: DEPRECATED :warning: 2 | In order to make BigTest development faster and friction free, we've consolidated all of our individual projects into a [single repository on the Frontside Organization](https://github.com/thefrontside/bigtest). We'd love to see you there! 3 | 4 | _note: the last release from this repository was 0.1.2_ 5 | 6 | ## @bigtest/react 7 | 8 | React DOM helpers for testing big 9 | 10 | ## What is this? 11 | 12 | This package aims to provide a set of helpers to make it easier to 13 | acceptance test your React applications. 14 | 15 | The `mount` helper will resolve after mounting a component in a 16 | freshly inserted DOM node. Subsequent uses will clean up any previously 17 | mounted component. 18 | 19 | ``` javascript 20 | import { mount } from '@bigtest/react'; 21 | import Button from '../src/components/button'; 22 | 23 | describe('My Button', () => { 24 | // `mount` returns a promise that resolves after rendering 25 | beforeEach(() => mount(() =>