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 { createJestConfig, jestConfig } = require('./jest.base.config'); | |
const extendedConfig = { | |
...jestConfig, | |
rootDir: '../../', | |
testRegex: '.(store|GlobalStore).test.ts$', | |
}; | |
module.exports = createJestConfig(extendedConfig); |
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 { createJestConfig, jestConfig } = require('./jest.base.config'); | |
const extendedConfig = { | |
...jestConfig, | |
rootDir: '../../', | |
testRegex: '.test.ts$', | |
testPathIgnorePatterns: [ | |
...jestConfig.testPathIgnorePatterns, | |
'^.+\\.(featureFlags|store|stores|services|utils)\\.test.t(s|x)$', | |
], |
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
/** | |
* src/App.tsx | |
*/ | |
import "./styles.css"; | |
import React from "react"; | |
import { Card } from "./Card"; | |
interface IProps {} | |
export const App: React.FC<IProps> = (props) => { |
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 } from "@testing-library/react"; | |
import { Card } from "./Card"; | |
describe("Card", () => { | |
test("does not throw", () => { | |
const { queryByText } = render(<Card />); | |
expect(() => queryByText("Card")).not.toThrow(); | |
}); |
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 "./styles.css"; | |
import React from "react"; | |
interface IProps {} | |
export const Card: React.FC<IProps> = (props) => { | |
return <div className="card">Card</div>; | |
}; | |
Card.dispalyName = "Card"; |
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
// bad | |
function displayName(name) { | |
if (name) { | |
return name; | |
} | |
return ''; | |
} | |
// good |
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
describe('.max()', () => { | |
describe('when `valueOne` is equal to `valueTwo`', () => { | |
test('should return `valueOne`', () => { | |
const valueOneMock = 1; | |
const valueTwoMock = 2; | |
const result = max(valueOneMock, valueTwoMock); | |
expect(result).toEqual(valueOneMock); | |
}); | |
}); |
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
describe('.max()', () => { | |
describe('when `valueOne` is equal to `valueTwo`', () => { | |
test('should return `valueOne`', () => { | |
const result = max(1, 1); | |
expect(result).toEqual(1); | |
}); | |
}); | |
describe('when `valueOne` is less than `valueTwo`', () => { |
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
lsof -i tcp:PORT_NUMBER # list processes using PORT_NUMBER | |
kill -9 PID # kill process with pid PID |
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 enum ExperimentName { | |
a = 'a', | |
b = 'b', | |
} | |
export type Experiment = { | |
[key in ExperimentName]: React.ReactNode; | |
}; | |
interface IProps extends Experiment { |
NewerOlder