This file contains hidden or 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
"scripts": { | |
"start": "react-scripts start", | |
"build": "react-scripts build", | |
"test": "jest", | |
"eject": "react-scripts eject" | |
} |
This file contains hidden or 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
module.exports = { | |
presets: [ | |
['@babel/preset-env', {targets: {node: 'current'}}], | |
'@babel/preset-typescript', | |
], | |
}; |
This file contains hidden or 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
Show hidden characters
{ | |
"compilerOptions": { | |
"target": "es5", | |
"types": [ | |
"node", | |
"jest" | |
], | |
"lib": [ | |
"dom", | |
"dom.iterable", |
This file contains hidden or 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 '@testing-library/jest-dom/extend-expect'; | |
import 'jest-styled-components' |
This file contains hidden or 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": { | |
"preset": "ts-jest", | |
"testEnvironment": "jest-environment-jsdom", | |
"snapshotSerializers": [ | |
"enzyme-to-json/serializer" | |
], | |
"collectCoverageFrom": [ | |
"src/**/*.{ts,tsx}" | |
], | |
"globals": { |
This file contains hidden or 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 renderer, { act } from 'react-test-renderer' | |
import App from '../App' | |
const mockData = { | |
data: [ | |
{ name: 'a fake name', surname: 'fake surname', email: '[email protected]' }, | |
{ | |
name: 'a fake name 2', | |
surname: 'fake surname 2', | |
email: '[email protected]', |
This file contains hidden or 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 TableList from './TableList' | |
import './App.css' | |
import axios from 'axios' | |
function App() { | |
const [users, setUsers] = React.useState([]) | |
React.useEffect(() => { | |
axios |
This file contains hidden or 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 styled from 'styled-components' | |
const StyledTable = styled.table` | |
border: 2px solid black; | |
` | |
const StyledTh = styled.th` | |
border-bottom: 1px solid black; | |
` |
This file contains hidden or 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
app.post('/create', (req,res) => { | |
const newCarObject = req.body; | |
Car.save(newCarObject, function (err, objectSaved) { | |
if (!err) { | |
res.json(objectSaved); | |
} else { | |
res.send(err) | |
} | |
}); | |
}) |
This file contains hidden or 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
app.get('/deploy', (req, res) => { | |
Car.deploy(function (err, success) { | |
if (!err) { | |
res.send("Contract deployed successfully!") | |
} else { | |
res.send("Contract deployment error" + err) | |
} | |
}) | |
}) |