Skip to content
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

Proposal: Monorepo #98

Closed
wants to merge 142 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
142 commits
Select commit Hold shift + click to select a range
9833627
New: init monorepo
alexkrolick Sep 13, 2018
836d5cb
feat: initial release
Mar 19, 2018
7f1c290
0.0.0
Mar 19, 2018
f00b67c
feat: initial release
Mar 19, 2018
573418d
fix(release): manually release a major version
Mar 19, 2018
c248a4b
docs: fix a few broken links
Mar 19, 2018
aafab78
docs: add useful comment
Mar 19, 2018
76c2e45
docs: add faq for enzyme
Mar 19, 2018
3ff74bb
fix(sel): match react native web's testID prop
Mar 19, 2018
a6c2f2e
docs(tests): add some more examples in tests
Mar 19, 2018
7ee8197
(docs): add faq entry about dealing with multiple data-testids (#4)
audiolion Mar 19, 2018
6c5a167
chore(prettier): fix syntax error in the rc file
Mar 19, 2018
bc15574
feat(unmount): add `unmount` to render object
Mar 19, 2018
220ab05
chore: rename internal utility sel to select (#5)
dnlsandiego Mar 20, 2018
33b91d0
chore: move code of conduct to root
Mar 20, 2018
e56b50f
chore(coc): forgot to git add
Mar 20, 2018
164a33b
feat(typings): add ts definitions (#7)
Miklet Mar 20, 2018
712278c
fix(TypeScript): add missing 'typings' folder to files property (#9)
Miklet Mar 20, 2018
42ea48e
Update axios.js
alejandronanez Mar 20, 2018
4112713
adding myself to the contributors list
alejandronanez Mar 20, 2018
77c1e85
feat(typings): add ts definitions (#7)
Miklet Mar 20, 2018
701f194
docs(contributors): fix contributor list
Mar 20, 2018
596415a
docs(goat): add goat logo
Mar 21, 2018
61758a2
docs: update goat
Mar 21, 2018
745ee62
feat: Add getByTestId utility (#10)
pbomb Mar 21, 2018
9a04ff6
feat(node): relax Node version requirement to >= 6 (#14)
wKovacs64 Mar 22, 2018
b91eef0
docs: add FAQ section about how flushPromises work (closes #11) (#15)
gnapse Mar 22, 2018
64e0758
feat(render): add new query capabilities for improved tests (#17)
Mar 23, 2018
a34dbf7
docs: update readme for getByLabelText (#24)
Mar 27, 2018
df42b1e
docs(problem-solution): update problem/solution
Mar 28, 2018
dc0f18b
feat(matchers): add custom jest matchers (#13)
antsmartian Mar 28, 2018
1d08b13
docs: fix you->your typo (#26)
stephenmathieson Mar 29, 2018
54487ca
fix: add the missed file `"extend-expect.js"` to `package.json` (#28)
antsmartian Mar 29, 2018
4d74bda
feat(waitForExpect): add waitForExpect (#25)
lgandecki Mar 29, 2018
b18dec8
fix(waitForExpect): rename to `wait`
Mar 29, 2018
f87d82f
fix(wait): be explicit about the timeout and interval
Mar 29, 2018
c89b166
docs(contributors): add sompylasar (#29)
sompylasar Mar 29, 2018
0d1c1ef
feat(getByAltText): add a new query utility
Mar 29, 2018
2d34532
fix(textMatch): if the textToMatch is not a string then it wont match
Mar 29, 2018
fc6de1a
docs: update getByAltText docs
Mar 30, 2018
f28c948
fix(jest-matchers): message should be function and added test cases f…
antsmartian Mar 30, 2018
c020aaa
fix(extend-expect): remove expect import
Apr 2, 2018
75e932c
fix(definitions): export correct types for wait and waitForExpect (#33)
jday3 Apr 2, 2018
1c619d7
docs: add documentation for using Matchers w/ Typescript (#37)
tsiq-swyx Apr 2, 2018
2c62eed
fix(release): manually release a patch version
Apr 2, 2018
7f65f4c
docs: update README.md (#39)
Apr 3, 2018
27d352d
fix(label): support aria-label (#42)
Apr 4, 2018
ad51d63
feat(matchers): add toHaveAttribute custom matcher (closes #43) (#44)
gnapse Apr 5, 2018
82b022d
feat: extract most of the logic to dom-testing-library
Apr 6, 2018
311b821
feat(fireEvent): add fireEvent from dom-testing-library (#48)
jomaxx Apr 10, 2018
9b38bb6
docs: fixes typo on the fireEvent example (#49)
aputhin Apr 10, 2018
b0e3130
docs: add React TDD examples with react-testing-library (#50)
mbaranovski Apr 10, 2018
fba1513
docs: remove unnecessary variable in the fireEvent documentation (#51)
thiagopaiva99 Apr 11, 2018
29e107a
fix(TypeScript): add a definition for TextMatch (#52)
thchia Apr 11, 2018
fcaaf36
docs: add note about snapshot diffing (#55)
jlongster Apr 13, 2018
cd36809
docs: fix typo in README (#56)
Gpx Apr 13, 2018
a988c42
docs: add note to docs about Simulate.click not working on browser ev…
thchia Apr 14, 2018
3b1255b
docs: add test example for context. (#60)
ChrisWcs Apr 21, 2018
8aa7d08
feat(queries): upgrade dom-testing-library to support all queries
Apr 24, 2018
527bd28
feat(waitForElement): add export of waitForElement
Apr 27, 2018
fa4cb0f
chore: document GitHub issues flow (#67)
alexkrolick May 2, 2018
e824eed
feat(examples): Add context examples (#68)
alexkrolick May 2, 2018
f00cff7
docs(spectrum): update the link
May 2, 2018
b5d6fc5
feat(rerender): implement rerender (#65) (#70)
johann-sonntagbauer May 3, 2018
76512c7
fix(TS): add types for exported functions. (#69)
maddijoyce May 3, 2018
0f47d15
chore: issue templates (#71)
alexkrolick May 4, 2018
851a031
fix: update getByTestId types (#74)
alexkrolick May 4, 2018
614230f
docs: copy in waitForElement docs (#73)
alexkrolick May 4, 2018
cd5d61b
feat(TextMatch): upgrade dom-testing-library
May 6, 2018
f16d581
test: adjust tests for breaking changes
May 6, 2018
fb662cc
fix(TS): examples + types (#77)
alexkrolick May 6, 2018
ef9a985
docs: update readme to add wait best practice recommendation that was…
RyanAtViceSoftware May 7, 2018
aca1729
docs(examples): add new react TDD example (#80)
May 8, 2018
357d4c0
fix(TS): type literal property cannot have an initializer (#82)
InExtremaRes May 8, 2018
c339cf4
tests: change mockImplementationOnce to mockResolvedValueOnce (#83)
Gpx May 8, 2018
8d711da
test: use mockResolvedValueOnce instead (#84)
May 8, 2018
23cf56a
docs: add advice to use fireEvent over Simulate (#85)
Gpx May 8, 2018
8a3c752
feat(debug): add a debug convenience method (#87)
May 15, 2018
f3f442e
fix(TS): Add missing getAll and queryAll functions to TS definitions …
pbomb May 18, 2018
278a45e
fix(TS): remove unused import to prevent naming conflict with export …
kamalgill May 18, 2018
4199e13
fix(TS): add debug() to typings (#90)
jgoz May 18, 2018
1582523
docs(examples): clarify examples (#92)
SavePointSam May 24, 2018
3c0a537
docs: add React.Fragment info (#98)
NickyMeuleman May 30, 2018
2173aa3
docs: add learning material section
May 30, 2018
fef54cf
docs: add workshop link
May 30, 2018
c33c2d0
docs: jest-dom for custom Jest matchers and blog post (#100)
rkotze Jun 1, 2018
dcca078
docs: fix typo in textMatch example(#101) (#102)
eliassotodo Jun 5, 2018
d66503a
docs: add article (#103)
Jun 5, 2018
777c67a
docs: update Feature Request issue template (#104)
gnapse Jun 5, 2018
c8c275e
docs: Add "Integration testing in React" to README (#105)
qswitcher Jun 5, 2018
7af3cf0
docs: fix typo in TextMatch documentation (#106)
bdelaforest Jun 5, 2018
47c7b8b
fix(TS): add missing prettyDOM export to typings file (#109)
icfantv Jun 8, 2018
c24fe74
fix: add support for react portal elements (#107)
spichen Jun 12, 2018
def1848
fix(TS): export RenderResult interface (#113)
knalinne Jun 12, 2018
44a0653
fix(engines): update engines.node in package.json
Jun 13, 2018
1f0a2fa
docs: update README.md (#117)
MarkPollmann Jun 15, 2018
e87c07f
feat(render): deprecate renderIntoDocument and make it the default (#…
Jun 19, 2018
16f9626
fix(cleanup): don't error out if the container is not in the body
Jun 19, 2018
de9ee9a
docs: add note about triggering onChange with a different value (#120)
silvenon Jun 20, 2018
4188c2d
docs(within): add within docs
Jun 21, 2018
7955212
docs: fix typos
Jun 21, 2018
5efeade
docs: fix variable name (#124)
Jun 22, 2018
09cc542
fix(TS): add JSDoc to typings of exported functions (#125)
MarkPollmann Jun 24, 2018
d75d166
feat(render): return baseElement from render (#127)
ehteshamkafeel Jun 27, 2018
c2d0e29
docs: change renderIntoDocument to render (#128)
yeion7 Jun 27, 2018
8a00d02
fix(TS): update typings with dom-testing-library queries and export t…
jpavon Jul 2, 2018
f04add8
fix(TS): clean up code from index.d.ts (#131)
jpavon Jul 3, 2018
c9e074d
docs: add render options Example for container (#132)
duncanleung Jul 8, 2018
488731a
chore: fix eslint issue in tests.
Jul 9, 2018
d92d92d
docs: add duncanleung as docs contributor (#133)
duncanleung Jul 9, 2018
daf4981
docs: New Learning Material section (#135)
tyagow Jul 13, 2018
1f67413
fix: ensure waitForElement responds to attribute and textNode changes…
rbrtsmith Jul 17, 2018
b8545a5
docs: fix syntax in wait example (#139)
zgreen Jul 18, 2018
5f6795b
docs: added Using Without Jest link to docs (#142)
dadamssg Jul 20, 2018
ec1fa42
docs: add new article to "Learning Material" section. (#143)
yazaabed Jul 20, 2018
dde5440
fix: switch default baseElement to document.body (#145)
timbonicus Jul 25, 2018
b151a0f
docs: add a contributor (#147)
timbonicus Jul 26, 2018
9e81ec0
fix(TS): declare optional argument to `debug` (#148)
gnapse Jul 26, 2018
38aa3a5
docs: add a video series to learning material (#149)
divyanshu013 Jul 29, 2018
14f6377
fix: Add baseElement to render return type (#151)
gnapse Aug 3, 2018
7f1e4ae
docs: replace getElementByText with getByText (#150)
nickserv Aug 4, 2018
131a598
fix: force upgrade of dom-testing-library
Aug 6, 2018
98d5c63
fix(change): no longer using Simulate.change
Aug 9, 2018
cb2ff8f
fix(revert): revert previous change (was a breaking change).
Aug 9, 2018
9bfc9d2
fix(change): no longer using Simulate.change
Aug 9, 2018
4058580
docs: add FAQ for the change event
Aug 10, 2018
cafb86c
chore: cleanup deprecated assertions
Aug 10, 2018
597ac14
docs: tiny fix (#158)
marktinsley Aug 15, 2018
6c307d9
docs: fix typo in README (#159)
Adam13531 Aug 16, 2018
1fc7b5a
docs: add link to example repo using react-testing-library to test a …
zth Aug 19, 2018
2d336d9
docs: update Readme.md (#163)
snaumov Aug 23, 2018
f08efe7
docs: update `debug` description (#164)
natenorberg Aug 23, 2018
bc162f7
docs: add missing curly brackets (#165)
eyalcohen4 Sep 2, 2018
919b214
fix(TS): update typings for optional option arguments (#168)
gnapse Sep 3, 2018
f851eea
docs: add global setup, custom render docs (#166)
alexkrolick Sep 4, 2018
2ea1b89
docs: update README.md (#171)
arturoromeroslc Sep 11, 2018
324fde4
docs: add wait section add query by text (#172)
petermakowski Sep 11, 2018
5931345
docs: parenthesis was incorrectly placed :) (#173)
Michielnuyts Sep 12, 2018
c6ef280
docs: add additional learning material to README (#174)
Lukeghenco Sep 12, 2018
1428251
New: add addon-async package
alexkrolick Sep 13, 2018
b8398ec
New: shuffle top level configs
alexkrolick Sep 13, 2018
e4c2484
Docs: fix links
alexkrolick Sep 13, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
dist
coverage
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
node_modules
coverage
dist
lib
.opt-in
.opt-out
.DS_Store
Expand Down
7 changes: 0 additions & 7 deletions .size-snapshot.json

This file was deleted.

2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ notifications:
email: false
node_js: '8'
install: npm install
script: npm run validate
script: lerna run validate
after_success: kcd-scripts travis-after-success
branches:
only: master
5 changes: 5 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# DOM Testing Packages

- [dom-testing-library](../packages/dom-testing-library) Core library
- [react-testing-library](../packages/react-testing-library) Wrapper for React
- [@dom-testing/addon-async](../packages/dom-testing-addon-async) Async query addon
6 changes: 6 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"packages": [
"packages/*"
],
"version": "independent"
}
78 changes: 11 additions & 67 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,73 +1,17 @@
{
"name": "dom-testing-library",
"version": "0.0.0-semantically-released",
"description": "Simple and complete DOM testing utilities that encourage good testing practices.",
"main": "dist/index.js",
"umd:main": "dist/dom-testing-library.umd.js",
"source": "src/index.js",
"typings": "typings",
"keywords": [
"testing",
"ui",
"dom",
"jsdom",
"unit",
"integration",
"functional",
"end-to-end",
"e2e"
],
"author": "Kent C. Dodds <[email protected]> (http://kentcdodds.com/)",
"name": "dom-testing",
"private": true,
"license": "MIT",
"engines": {
"node": ">=6"
},
"scripts": {
"add-contributor": "kcd-scripts contributors add",
"build": "kcd-scripts build && kcd-scripts build --bundle umd --no-clean",
"lint": "kcd-scripts lint",
"test": "kcd-scripts test",
"test:update": "npm test -- --updateSnapshot --coverage",
"validate": "kcd-scripts validate",
"setup": "npm install && npm run validate -s",
"precommit": "kcd-scripts precommit",
"dtslint": "dtslint typings"
},
"files": [
"dist",
"typings"
"workspaces": [
"packages/*"
],
"dependencies": {
"pretty-format": "^22.4.3",
"mutationobserver-shim": "^0.3.2",
"wait-for-expect": "^1.0.0"
"scripts": {
"postinstall": "npm-run-all bootstrap",
"bootstrap": "lerna bootstrap"
},
"devDependencies": {
"dtslint": "^0.3.0",
"jest-dom": "^1.7.0",
"jest-in-case": "^1.0.2",
"kcd-scripts": "^0.41.0",
"microbundle": "^0.4.4"
},
"eslintConfig": {
"extends": "./node_modules/kcd-scripts/eslint.js",
"rules": {
"import/prefer-default-export": "off",
"import/no-unassigned-import": "off",
"import/no-useless-path-segments": "off"
}
},
"eslintIgnore": [
"node_modules",
"coverage",
"dist"
],
"repository": {
"type": "git",
"url": "https://github.com/kentcdodds/dom-testing-library.git"
},
"bugs": {
"url": "https://github.com/kentcdodds/dom-testing-library/issues"
},
"homepage": "https://github.com/kentcdodds/dom-testing-library#readme"
"kcd-scripts": "^0.44.0",
"lerna": "^3.3.2",
"npm-run-all": "^4.1.3"
}
}
6 changes: 6 additions & 0 deletions packages/dom-testing-addon-async/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
flow-typed
lib
dist
.cache
coverage
31 changes: 31 additions & 0 deletions packages/dom-testing-addon-async/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"parser": "babel-eslint",
"plugins": [
"flowtype",
"prettier",
"jsx-a11y"
],
"extends": [
"prettier",
"prettier/flowtype",
"prettier/react",
"plugin:flowtype/recommended",
"plugin:prettier/recommended",
"plugin:jsx-a11y/recommended",
"react-app"
],
"rules": {
"prettier/prettier": [
"error",
{
"parser": "flow",
"trailingComma": "all"
}
]
},
"env": {
"node": true,
"browser": true,
"jest": true
}
}
11 changes: 11 additions & 0 deletions packages/dom-testing-addon-async/.flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[ignore]

[include]

[libs]

[lints]

[options]

[strict]
123 changes: 123 additions & 0 deletions packages/dom-testing-addon-async/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
# File created using '.gitignore Generator' for Visual Studio Code: https://bit.ly/vscode-gig

# Created by https://www.gitignore.io/api/macos,visualstudiocode,node

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json


# End of https://www.gitignore.io/api/macos,visualstudiocode,node

# Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option)

/lib/*
/dist/*
!/lib/index.js.flow
!/dist/index.js.flow
5 changes: 5 additions & 0 deletions packages/dom-testing-addon-async/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Maintainers of this addon will be requested for code review

* @alexkrolick
*.js @alexkrolick
*.md @alexkrolick
45 changes: 45 additions & 0 deletions packages/dom-testing-addon-async/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# @dom-testing/addon-async

Async query addon for dom-testing-library

## Usage

### `find*`

Fach of the `get` and `getAll` queries from `dom-testing-library` are wrapped in an async `find` API.

The find APIs return a Promise and retry automatically until they time out. The timeout can be specified as an option in the last argument.

```js
import { findByLabelText, findByText } from '@dom-testing/addon-async'

fireEvent.click(getByRole('log-in'))
// This element doesn't appear immediately:
const usernameElement = await findByLabelText('username', {timeout: 200})
usernameElement.value = 'chucknorris'
// wait for error state
expect(await findByText('Error: Name must be capitalized')).not.toBeNull()
// expect NOT to see success state
await expect(findByText('Everything OK!')).rejects.toMatchInlineSnapshot()
```

### `waitFor`

`waitFor` is a utility function that lets you retry queries until they succeed or time out. Unlike `dom-testing-library#wait`, `waitFor` returns the result of the function. It is used internally to create the find APIs.

The first argument is the query. A new async function is returned if this is the only argument. If there are more arguments, it returns a Promise which resolves with the result of calling the async function with the arguments. If the last argument is an object with a "timeout" key, it will be used as the timeout for the retries. The Promise is rejected with the last error thrown by the callback.

```js
const usernameElement = await waitFor(getByLabelText, container, 'username')
usernameElement.value = 'chucknorris'
```

You can create your own async queries by passing only the first argument:

```js
const waitForText = waitFor(getByText)

const headline = await waitForText('news flash')

expect(headline).toBeDefined() // do something
```
File renamed without changes.
Loading