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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |
<meta name="theme-color" content="#000000" /> | |
<meta | |
name="description" | |
content="Web site created using create-react-app" |
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
{ | |
"name": "@nemrosim/npm-package-example", | |
"version": "1.0.0", | |
+ "description": "Some description", | |
"repository": { | |
"type": "git", | |
"url": "https://github.com/nemrosim/npm-package-create-test-deploy-examples" | |
- } | |
+ }, | |
+ "bugs": { |
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 React from 'react'; | |
import { render, screen } from '@testing-library/react'; | |
import { App } from './App'; | |
// ... other tests | |
describe('diff approaches', () => { | |
// helper | |
function textContentMatcher(text) { | |
return function (_content, node) { |
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 sameImage = screen.getByAltText('logo'); | |
expect(sameImage).toBeInTheDocument(); | |
}); | |
+ | |
+it('should render paragraph with text', () => { | |
+ render(<App />); | |
+ | |
+ expect( | |
+ screen.getByText('Edit src/App.tsx and save to reload.'), | |
+ ).toBeInTheDocument(); |
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 React from 'react'; | |
import { render, screen } from '@testing-library/react'; | |
import { App } from './App'; | |
it('renders learn react link', () => { | |
render(<App />); | |
const linkElement = screen.getByText(/learn react/i); | |
expect(linkElement).toBeInTheDocument(); | |
}); |
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 React from 'react'; | |
import logo from './logo.svg'; | |
import './App.css'; | |
export const App = () => ( | |
<div className="App"> | |
<header className="App-header"> | |
<img src={logo} className="App-logo" alt="logo" /> | |
<p> | |
Edit <code>src/App.tsx</code> and save to reload. |
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 React from 'react'; | |
import { render, screen } from '@testing-library/react'; | |
import App from './App'; | |
test('renders learn react link', () => { | |
render(<App />); | |
const linkElement = screen.getByText(/learn react/i); | |
expect(linkElement).toBeInTheDocument(); | |
}); |
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 React from 'react'; | |
export const withSomething = (WrappedComponent, context) => { | |
return (props) => { | |
return <WrappedComponent/>; | |
} | |
}; |
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 React, { useEffect, useState } from 'react'; | |
+import React, { useCallback, useEffect, useState } from 'react'; | |
import { I18nProvider as LinguiI18nProvider } from "@lingui/react"; | |
import { i18n } from "@lingui/core"; | |
+import { | |
+ detect, | |
+ fromCookie, | |
+ fromHtmlTag, | |
+ fromNavigator, | |
+ fromPath, |
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 React from "react"; | |
-import { Plural } from "@lingui/macro"; | |
+import { Plural, plural } from "@lingui/macro"; | |
export const JSXPlurals: React.FC = () => { | |
const amountList = [ 0, 1, 2, 5, 100 ] | |
+ const jsMacrosExample = (amount: number) => plural(amount, { | |
+ one: "You got {amount} item (one)", |