Skip to content

Instantly share code, notes, and snippets.

View benawad's full-sized avatar

Ben Awad benawad

View GitHub Profile
type Auth {
register(username: String!, password: String!): User
}
type Query {
auth: Auth
}
data={orderBy(
this.state.query
? this.state.data.filter(x =>
Object.values(x).some(s =>
s.toLowerCase()
.includes(lowerCaseQuery))
)
: this.state.data,
this.state.columnToSort,
this.state.sortDirection
GraphQLHTTP(req => {
console.log(req.user);
return {
schema: motobanSchema,
graphiql: true,
context: {
SECRET,
user: req.user
}
}
let el;
await wait(() => {
el = queryByText("Yes")
return el;
})
FireEvent.click(el);
{
request: {
query: DELETE_TAG,
variables: { id: "123" }
},
result: {
data: {
deleteTag: {
id: "123",
displayName: "something"
{
"presets": ["@babel/preset-env"],
"env": {
"production": {
"plugins": [
["emotion", { "hoist": true }],
["@babel/plugin-syntax-dynamic-import"]
]
},
"development": {
{
// Place your snippets for typescriptreact here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
"Typescript React PureComponent": {
"prefix": "rpc",
"body": [
"import * as React from 'react'",
import * as React from "react";
import { Route } from "react-router-dom";
import { fireEvent, waitForElement, wait } from "react-testing-library";
import LoginConnector from "./LoginConnector";
const email = "tom@tom.com";
const password = "asdfasdfasdfasdf";
it("testing Login Connector", () => {
[
"Trying out GraphQL",
"out GraphQL",
"GraphQL"
]
import { ReactTestInstance } from "react-test-renderer";
export const textInTree = (
root: string | ReactTestInstance,
text: string
): boolean => {
if (typeof root === "string") {
return text === root;
}