Skip to content

Instantly share code, notes, and snippets.

Concept Review

Bundles

  • Processed output files emitted by a bundler (Webpack)
  • Contain chunks

Chunks

  • Entry chunk
    • contains Webpack bootstrap code (also called the webpack "runtime") needed to run your app
    • must go in <script> tag
  • Normal chunk

Tests

  • No more explicitly done with setTimeout !!
// mass assign
let config,
contents,
requestDate,
requestStatus
if (section) {
({ config, contents, requestDate, requestStatus } = section)
}

General structure

  • very similar to Website tests
import { isLegitAdmin } from 'utils/UserUtils'

describe('UserUtils', () => {
    it('`isLegitAdmin` returns false if no `user` is provided', () => {
        expect(isLegitAdmin()).toBe(false)
    })
-- niche.com DNS prefetch --
https://css-tricks.com/prefetching-preloading-prebrowsing/
-- env variables --
https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#adding-development-environment-variables-in-env
-- lazy loading & code splitting via dynamic imports --
http://serverless-stack.com/chapters/code-splitting-in-create-react-app.html
http://192.168.0.165:3001/edit-profile/students
test-yxfbakih
kcooperrider+1
[email protected] (a)
[email protected] (non-a)
http://192.168.0.165:3001