Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wyze/bs-dom-testing-library
BuckleScript bindings for dom-testing-library.
https://github.com/wyze/bs-dom-testing-library
Last synced: 15 days ago
JSON representation
BuckleScript bindings for dom-testing-library.
- Host: GitHub
- URL: https://github.com/wyze/bs-dom-testing-library
- Owner: wyze
- License: mit
- Created: 2018-06-04T16:30:38.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T16:15:51.000Z (almost 2 years ago)
- Last Synced: 2024-09-17T18:34:06.663Z (about 2 months ago)
- Language: Reason
- Homepage: https://yarn.pm/bs-dom-testing-library
- Size: 495 KB
- Stars: 15
- Watchers: 3
- Forks: 6
- Open Issues: 14
-
Metadata Files:
- Readme: readme.md
- Changelog: changelog.md
- Funding: .github/funding.yml
- License: license
Awesome Lists containing this project
- awesome-list - bs-dom-testing-library - testing-library. | wyze | 14 | (Reason)
README
# bs-dom-testing-library · [![Build Status][circleci-image]][circleci-url] [![npm][npm-image]][npm-url] [![Coveralls][codecov-image]][codecov-url]
> [BuckleScript](//github.com/BuckleScript/bucklescript) bindings for [dom-testing-library](//github.com/testing-library/dom-testing-library).
## Documentation
[**Read the docs**](//testing-library.com/docs/bs-react-testing-library/intro) | [Edit the docs](//github.com/alexkrolick/testing-library-docs)
## Installation
```sh
$ yarn add --dev bs-dom-testing-library# or..
$ npm install --save-dev bs-dom-testing-library
```## Usage
#### Add to `bsconfig.json`
```json
{
"bs-dev-dependencies": [
"bs-dom-testing-library"
]
}
```#### With [`bs-jest`](//github.com/reasonml-community/bs-jest)
```ocaml
/* Header_test.re */open Jest;
open Expect;
open Webapi.Dom;
open Webapi.Dom.Element;test("header exists", () => {
let div = Document.createElement("div", document);div->setInnerHTML({|
Hello, World!
|});div
|> getByText(~matcher=`Str("Hello, World!"))
|> expect
|> ExpectJs.toBeTruthy;
});
```## Examples
See [`src/__tests__`](src/__tests__) for some examples.
## Development
```sh
$ git clone https://github.com/wyze/bs-dom-testing-library.git
$ cd bs-dom-testing-library
$ yarn # or `npm install`
```## Build
```sh
$ yarn build
```## Test
```sh
$ yarn test
```## Change Log
> [Full Change Log](changelog.md)
### [v0.7.0](https://github.com/wyze/bs-dom-testing-library/releases/tag/v0.7.0) (2020-10-21)
* Add waitForElementToBeRemoved ([@wyze](https://github.com/wyze) in [#23](https://github.com/wyze/bs-dom-testing-library/pull/23))
* Add more ByRole options ([@wyze](https://github.com/wyze) in [#22](https://github.com/wyze/bs-dom-testing-library/pull/22))
* Update some of the utility functions ([@wyze](https://github.com/wyze) in [#21](https://github.com/wyze/bs-dom-testing-library/pull/21))
* Add sponsor button ([@wyze](https://github.com/wyze) in [dec1dab](https://github.com/wyze/bs-dom-testing-library/commit/dec1dab))
* Upgrade to latest dependencies ([@wyze](https://github.com/wyze) in [#20](https://github.com/wyze/bs-dom-testing-library/pull/20))## License
MIT © [Neil Kistner](https://neilkistner.com)
[circleci-image]: https://img.shields.io/circleci/project/github/wyze/bs-dom-testing-library.svg?style=flat-square
[circleci-url]: https://circleci.com/gh/wyze/bs-dom-testing-library[npm-image]: https://img.shields.io/npm/v/bs-dom-testing-library.svg?style=flat-square
[npm-url]: https://npm.im/bs-dom-testing-library[codecov-image]: https://img.shields.io/codecov/c/github/wyze/bs-dom-testing-library.svg?style=flat-square
[codecov-url]: https://codecov.io/github/wyze/bs-dom-testing-library