{
"name": "George Washington",
"birthday": "February 22, 1732",
"address": "Mount Vernon, Virginia, United States"
}
{
"first_name": "George",
"last_name": "Washington",
sd |
Passing in arguments via the command line
all command-line arguments received by the shell are given to the process in an array called argv
console.log(process.argv);
Now save it, and try the following in your shell:
$ node argv.js one two three four five
When we talk about mocking in Jest, we’re typically talking about
replacing dependencies with the Mock Function.
review the Mock Function, and then dive into the different ways you can replace dependencies with it. The Mock Function The goal for mocking is to replace something we don’t control with something we do,
// myModule.test.js
jest.mock('./myModule.js', () => (
{
...(jest.requireActual('./myModule.js')),
otherFn: jest.fn()
}
))
Dockerizing a Node.js Web Application
https://semaphoreci.com/community/tutorials/dockerizing-a-node-js-web-application
“Docker is an open platform for building, shipping and running distributed applications. It gives programmers, development teams and operations engineers the common toolbox they need to take advantage of the distributed and networked nature of modern applications.”
is an abstraction on top of low-level operating system tools that allows you to run one or more containerized processes or applications within one or more virtualized Linux instances.
Starting a new project
yarn init Adding a dependency
yarn add [package]
yarn add [package]@[version]
yarn add [package]@[tag]
const { container, getByDisplayValue, getByTestId, debug } = renderWithProviders(
<FieldComponentRenderer {...props} enableError={true}/>
);
debug()
import React from 'react' | |
import ReactDOM from 'react-dom' | |
import { Key } from '../utils/keyboardUtils' | |
export default class FocusManager extends React.Component { | |
constructor(props) { | |
super(props) | |
this._immediateID = null | |
this.state = { |