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) | |
} | |
}) | |
}) |
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
const ethAirBalloons = require('ethairballoons'); | |
const path = require('path'); | |
const savePath = path.resolve(__dirname + '/contracts'); | |
const express = require('express') | |
const bodyParser = require('body-parser') | |
const app = express() | |
const port = 3000 | |
app.use(bodyParser.json()) | |
const ethAirBalloonsProvider = ethAirBalloons('http://localhost:8545', savePath); |
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
var updatedCarObject = { engine: 'V9', wheels: 4 }; | |
Car.updateById('Audi A4', updatedCarObject, function (err, updatedObject) { | |
if (!err) { | |
console.log('object updated successfully'); | |
} | |
}); |