Comments (6)
To answer your second question:
describe
is just a name applied to the tape
testing library. You would import it like any other dependency:
import describe from 'tape'
Instead of:
test('CardPlayer', nest => {
nest.test('...card-player', assert => {
const msg = 'CardPlayer should render the card-player div.';
You write:
describe('CardPlayer', ({test}) => {
test('...card-player', ({equal, end}) => {
const msg = 'CardPlayer should render the card-player div.';
You're using ES6 destructuring this way so you can avoid having to write assert.equal
and assert.end
and instead just write equal
and end
.
It's a question of style and what you prefer.
from rejection.
- Constant strings don't matter much as long as:
- They're easy to read and identify &
- They don't collide with similarly named stuff in other modules.
from rejection.
I notice my UI is very ugly compared to others 😂. I will try to improve that.
from rejection.
@thoragio Thanks. I decided to use firebase and material design for the mid-level challenge.
from rejection.
On 3, I use the connect
utility from react-redux which provides mapStateToProps()
and mapDispatchToProps()
in smart components, which will connect the redux state to props that can flow to presentation components through props.
Then you can use whatever async API you like to load the state and then dispatch an action to the store after the state is loaded. Common choices include:
- redux-saga
- redux-thunk
- vanilla-js (create your own solution)
I personally prefer redux-saga, but before you dive into that, you need to understand generators.
Option 3 is easiest to start with.
from rejection.
Next time I want to see tests for components, too. See TDD in ES6 & React. Ignore the bits about Enzyme -- it was still flaky last I checked. I use Cheerio, instead.
You don't get synthetic event tests that way, but I just use functional tests for that. See Nightwatch.js for easy functional testing.
from rejection.
Related Issues (20)
- Basic Level: Completed HOT 1
- Challenge completed level: basic
- Challenge completed level: basic HOT 1
- mid level HOT 2
- Rejection App
- Challenge completed level: basic HOT 1
- Challenge completed: Basic HOT 1
- Challenge completed level: basic HOT 1
- Challenge completed level: Mid HOT 1
- Challenge Completed: Basic Level HOT 4
- Mid level completed.
- Challenge completed level: basic HOT 1
- Challenge completed level: basic
- Challenge completed level: save/load state saga
- Challange completed: expert level
- Challenge completed: Basic level HOT 1
- Mid Level Challenge Completed HOT 2
- Challenge completed: basic level HOT 1
- Mid Level Completed! HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rejection.