View istekler.js
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
var x = document.querySelectorAll('button.artdeco-button--secondary'); | |
for (var i = 0; i < x.length; i++) { | |
x[i].click(); | |
} |
View App.test.tsx
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 { fireEvent, render, screen } from "@testing-library/react"; | |
import App from "./App"; | |
import fetchMock from "jest-fetch-mock"; | |
import fetch from "jest-fetch-mock"; | |
fetchMock.enableMocks(); | |
beforeEach(() => { | |
fetch.resetMocks(); | |
}); |
View Repos.test.tsx
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 { fireEvent, render, screen } from "@testing-library/react"; | |
import Repos from "./Repos"; | |
test("renders user's repos", async () => { | |
render(<Repos />); | |
const button = screen.getByText(/Get repos/i); | |
fireEvent.click(button); | |
const txtRepo = await screen.findByText(/boysenberry/i); | |
expect(txtRepo).toBeInTheDocument(); |
View setupTests.ts
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
// jest-dom adds custom jest matchers for asserting on DOM nodes. | |
// allows you to do things like: | |
// expect(element).toHaveTextContent(/react/i) | |
// learn more: https://github.com/testing-library/jest-dom | |
import "@testing-library/jest-dom"; | |
const unmockedFetch = global.fetch; | |
beforeAll(() => { | |
const getDataByUrl = (url: string) => { | |
switch (url) { |
View Repos.tsx
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 { useState } from "react"; | |
type Repo = { | |
full_name: string; | |
}; | |
function Repos() { | |
const [repos, setRepos] = useState<Repo[] | null>(null); | |
const [userName, setUserName] = useState<string>("octocat"); | |
const getRepos = () => { |
View App.test.tsx
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 { fireEvent, render, screen } from "@testing-library/react"; | |
import App from "./App"; | |
const unmockedFetch = global.fetch; | |
beforeAll(() => { | |
global.fetch = () => | |
Promise.resolve({ | |
json: () => | |
Promise.resolve({ |
View App.tsx
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 { useState } from "react"; | |
type User = { | |
name: string; | |
followers: string; | |
following: string; | |
}; | |
function App() { | |
const [user, setUser] = useState<User | null>(null); |
View FrameHostObject.cpp
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 "FrameHostObject.h" | |
#import <Foundation/Foundation.h> | |
#import <jsi/jsi.h> | |
// This method returns all of keys | |
std::vector<jsi::PropNameID> FrameHostObject::getPropertyNames(jsi::Runtime& rt) { | |
std::vector<jsi::PropNameID> result; | |
result.push_back(jsi::PropNameID::forUtf8(rt, std::string("toString"))); | |
result.push_back(jsi::PropNameID::forUtf8(rt, std::string("isValid"))); | |
result.push_back(jsi::PropNameID::forUtf8(rt, std::string("width"))); |
View FrameHostObject.h
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
#pragma once | |
#import <jsi/jsi.h> | |
#import <CoreMedia/CMSampleBuffer.h> | |
#import "Frame.h" | |
using namespace facebook; | |
class JSI_EXPORT FrameHostObject: public jsi::HostObject { | |
public: |
View index.js
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 list = [ | |
"abacı", | |
"abadi", | |
"abalı", | |
"abana", | |
"abani", | |
"abaşo", | |
"abaza", | |
"abbas", | |
"abdal", |
NewerOlder