New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

riot-testing-library

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

riot-testing-library - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

dont-cleanup-after-each.js

2

package.json
{
"name": "riot-testing-library",
"version": "1.0.0",
"version": "1.1.0",
"description": "Simple and complete Riot testing utilities that encourage good testing practices.",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -8,2 +8,3 @@ # riot-testing-library

[![codecov](https://codecov.io/gh/ariesjia/riot-testing-library/branch/master/graph/badge.svg)](https://codecov.io/gh/ariesjia/riot-testing-library)
[![Maintainability](https://api.codeclimate.com/v1/badges/d58d5b16adaf9a87c8df/maintainability)](https://codeclimate.com/github/ariesjia/riot-testing-library/maintainability)

@@ -33,9 +34,6 @@ ## API

Unmounts the component from the container and destroys the container.
`cleanup()` is called after each test automatically by default if the testing framework you're using supports the afterEach global (like mocha, Jest, and Jasmine).
However, you may choose to skip the auto cleanup by setting the RIOT_TL_SKIP_AUTO_CLEANUP env variable to 'true'.
To make this even easier, you can also simply import `riot-testing-library/dont-cleanup-after-each` which will do the same thing.
```javascript
afterEach(() => {
cleanup()
})
```
### also export all api from [@testing-library/dom](https://testing-library.com/docs/dom-testing-library/intro)

@@ -46,3 +44,3 @@

### Component
```riotjs
```html
<app>

@@ -68,9 +66,5 @@ <p data-testid="count">{ state.count }</p>

```javascript
import render, { cleanup, fireEvent } from 'riot-testing-library'
import render, { fireEvent } from 'riot-testing-library'
import TestTag from './test.tag'
afterEach(() => {
cleanup()
})
test('should show count text when rendered', () => {

@@ -81,3 +75,3 @@ const { queryByTestId } = render(TestTag, {count: 10});

test('should add count when click add button text', async () => {
test('should add count when click add button text', () => {
const { queryByTestId } = render(TestTag, {count: 1});

@@ -84,0 +78,0 @@ expect(queryByTestId('count').textContent).toBe("1");

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc