#The keyboard shortcut commands are Go Forward and Go Back.
ctrl
+ -
== navigate back
ctrl
+ shift
+ -
== navigate forward
#The keyboard shortcut commands are Go Forward and Go Back.
ctrl
+ -
== navigate back
ctrl
+ shift
+ -
== navigate forward
import { render, fireEvent, screen } from "@testing-library/react"; | |
import { rest } from "msw"; | |
import { setupServer } from "msw/node"; | |
import App from "./App"; | |
const joke = 'Foo Bar!'; | |
const server = setupServer( | |
rest.get("https://api.icndb.com/jokes/random", (req, res, ctx) => { | |
return res( |
import Enzyme from 'enzyme'; | |
import Adapter from '@wojtekmaj/enzyme-adapter-react-17'; | |
import { shallow } from 'enzyme'; | |
import App from './App'; | |
import axios from 'axios'; | |
Enzyme.configure({ adapter: new Adapter() }); | |
const joke = 'Foo Bar!'; |
import "./styles.css"; | |
import { useState } from "react"; | |
import { get } from "axios"; | |
export default function App() { | |
const [joke, setJoke] = useState(null); | |
const [error, setError] = useState(null); | |
const fetchJoke = async () => { | |
try { |
export function CustomPromise(executorFn) { | |
const PossibleStates = { | |
PENDING: 'PENDING', | |
RESOLVED: 'RESOLVED', | |
REJECTED: 'REJECTED', | |
}; | |
let currentSuccessResult; | |
let currentFailureResult; | |
const listOfSuccessCallbacks = []; | |
const listOfFailureCallbacks = []; |
{ | |
"presets": [ | |
[ | |
"@babel/preset-env", | |
{ | |
"useBuiltIns": "usage", | |
"corejs": 2 | |
} | |
], | |
"@babel/preset-react" |
{ | |
"jest": { | |
"verbose": true, | |
"testPathIgnorePatterns": [ | |
"/smoke-tests/" | |
], | |
"coverageDirectory": "coverage-client", | |
"collectCoverageFrom": [ | |
"<rootDir>/src/**/*.js", | |
"!<rootDir>/webpack/*", |
exports.handler = async (event, context) => { | |
const { | |
user | |
} = context.clientContext; | |
if (user) { | |
const userID = user.sub; | |
return { | |
statusCode: 200, | |
body: JSON.stringify({ |
const fetch = require("node-fetch"); | |
exports.handler = async function(event, context) { | |
const data = JSON.parse(event.body) | |
const { user } = data | |
const responseBody = { | |
user_metadata: { | |
...user.user_metadata, | |
} |
mutation AddTodo { | |
insert_todos(objects: {title: "Learning GraphQL", userId: "user-id-1101", complete: false}) { | |
returning { | |
complete | |
date_created | |
id | |
title | |
user { | |
id | |
name |