This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function logGoogleEvent(action,label=void 0){"function"==typeof window.gtag&&window.gtag("event",action,{event_category:"Page feedback",event_label:label})}const LANG_TO_CONTENT={en:{ratingPrompt:"Did you find what you were looking for on this page?",ratingPositive:"Yes",ratingNegative:"No",commentPromptPositive:"Great! We're looking for ways to improve this page — what ideas come to mind?",commentPromptNegative:"Sorry to hear that. What were you looking for today?",commentPromptDisclaimer:"Your feedback helps improve this web page. For specific questions about your situation, ",commentPromptDisclaimerLink:"contact us",commentSubmit:"Send feedback",commentSubmitLoading:"Sending...",commentConfirmation:"Thanks for sharing your thoughts!",emailPrompt:"To hear about paid feedback opportunities in the future, join our user testing list.",emailLabel:"Email address",emailSubmit:"Join the list",emailSubmitLoading:"Joining...",errorMessage:"Try again, please. We didn't get your answer because of a technical issue.",e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"created_at": "Sun Nov 29 19:16:18 +0000 2019", | |
"id": 1333127345342797440, | |
"id_str": "1333127345342797440", | |
"truncated": false, | |
"entities": { | |
"symbols": [], | |
"user_entities": [ | |
{ | |
"name": "Firstname Lastname", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getName = (response: ApiResponse): string => { | |
let fullName = ""; | |
if (response.person.firstName && response.person.lastName) { | |
fullName = `${response.person.firstName} ${response.person.lastName}` | |
} | |
return fullName; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import externalApiFixtureData from "./onetTestDataTasks.json"; | |
import {getUserDetailsForId} from "./apiClient.ts"; | |
jest.mock("axios"); | |
const mockedAxios = axios as jest.Mocked<typeof axios>; | |
describe("my cool external API integration", () => { | |
it("returns description when tasks and related occupations fail", async () => { | |
mockedAxios.get.mockResolvedValue({data: externalApiFixtureData}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git() { | |
if [ "$1" = "push" ] | |
then | |
read "response?Are you sure you want to push without SHIP-IT????? [y/N] " | |
if [[ "$response" =~ ^([yY][eE][sS]|[yY])+$ ]] | |
then | |
command git "$@" | |
else | |
echo "NOT PUSHING, GREAT JOB BY YOU" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function mockFunctions() { | |
const original = jest.requireActual('@reach/router'); | |
return { | |
...original, | |
navigate: jest.fn(), | |
} | |
} | |
jest.mock('@reach/router', () => mockFunctions()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* i'm sorry but gmail's font is just better imo */ | |
@font-face { | |
font-family: 'Segoe UI'; | |
font-style: normal; | |
font-weight: 400; | |
src: local('Roboto'), local('Roboto-Regular'), url(https://fonts.gstatic.com/s/roboto/v20/KFOmCnqEu92Fr1Mu4mxKKTU1Kg.woff2) format('woff2'); | |
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; | |
} | |
@font-face { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it('transforms into a user entity', () => { | |
const user = buildDefaultUser({}); | |
const expectedUserEntity = { | |
username: user.name, | |
password: user.password | |
}; | |
expect(userTransformer.transform(user)).toEqual(expectedUserEntity); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface User { | |
name: String, | |
password: String | |
} | |
const random = (): number => { | |
return Math.floor(Math.random() * Math.floor(10000000)); | |
}; | |
export const buildDefaultUser = (partial: Partial<User>): User => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
void transformsIntoAUserEntity() { | |
// given a user | |
User user = easyRandom.nextObject(User.class); | |
// when we call transform on the user | |
UserEntity userEntity = userTransformer.transform(user); | |
// then we get a user entity with fields populated from the user fields |
NewerOlder