This app provides monitoring and information features for the common freifunk user and the technical stuff of a freifunk community.
Code base is taken from a TUM Practical Course project and added here to see if Freifunk Altdorf can use it.
https://www.freifunk-altdorf.de
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
1011 B
27 lines
1011 B
6 years ago
|
# `react-test-renderer`
|
||
|
|
||
|
This package provides an experimental React renderer that can be used to render React components to pure JavaScript objects, without depending on the DOM or a native mobile environment.
|
||
|
|
||
|
Essentially, this package makes it easy to grab a snapshot of the "DOM tree" rendered by a React DOM or React Native component without using a browser or jsdom.
|
||
|
|
||
|
Documentation:
|
||
|
|
||
|
[https://reactjs.org/docs/test-renderer.html](https://reactjs.org/docs/test-renderer.html)
|
||
|
|
||
|
Usage:
|
||
|
|
||
|
```jsx
|
||
|
const ReactTestRenderer = require('react-test-renderer');
|
||
|
|
||
|
const renderer = ReactTestRenderer.create(
|
||
|
<Link page="https://www.facebook.com/">Facebook</Link>
|
||
|
);
|
||
|
|
||
|
console.log(renderer.toJSON());
|
||
|
// { type: 'a',
|
||
|
// props: { href: 'https://www.facebook.com/' },
|
||
|
// children: [ 'Facebook' ] }
|
||
|
```
|
||
|
|
||
|
You can also use Jest's snapshot testing feature to automatically save a copy of the JSON tree to a file and check in your tests that it hasn't changed: https://facebook.github.io/jest/blog/2016/07/27/jest-14.html.
|