Giter Site home page Giter Site logo

Comments (6)

thoragio avatar thoragio commented on August 14, 2024 1

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.

ericelliott avatar ericelliott commented on August 14, 2024 1
  1. Constant strings don't matter much as long as:
    1. They're easy to read and identify &
    2. They don't collide with similarly named stuff in other modules.

from rejection.

maxyzli avatar maxyzli commented on August 14, 2024

I notice my UI is very ugly compared to others 😂. I will try to improve that.

from rejection.

maxyzli avatar maxyzli commented on August 14, 2024

@thoragio Thanks. I decided to use firebase and material design for the mid-level challenge.

from rejection.

ericelliott avatar ericelliott commented on August 14, 2024

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:

  1. redux-saga
  2. redux-thunk
  3. 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.

ericelliott avatar ericelliott commented on August 14, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.