Look at LSB init scripts for more information.
Copy to /etc/init.d
:
# replace "$YOUR_SERVICE_NAME" with your service's name
Look at LSB init scripts for more information.
Copy to /etc/init.d
:
# replace "$YOUR_SERVICE_NAME" with your service's name
.App { | |
display: flex; | |
flex-direction: column; | |
height: 100vh; | |
color: white; | |
overflow: hidden; | |
} | |
.App-header { |
import {fetchRestaurants, RESTAURANTS_URL} from '../utils' | |
import * as fixtures from '../fixtures' | |
jest.spyOn(global, 'fetch') | |
describe('fetchRestaurants', ()=>{ | |
beforeEach(()=>{ | |
global.fetch.mockClear() | |
global.fetch.mockResolvedValue({text: ()=>JSON.stringify(fixtures.dummyRestaurants)}) |
[ | |
{ | |
"id": 1, | |
"name": "MacDonald", | |
"location": [27.696927, 85.329353] | |
}, | |
{ | |
"id": 2, | |
"name": "Bajeko Sekuwa", | |
"location": [26.212754, 84.961525] |
import React from 'react' | |
import {render, fireEvent} from '@testing-library/react' | |
import Restaurants from '../Restaurants' | |
import * as fixtures from '../fixtures' | |
import {calculateDistance} from '../utils' | |
jest.mock('../utils') | |
describe("Restaurants Component", ()=>{ | |
it("should render restaurants passed to it", ()=>{ | |
// render function returns a handle |
import React, { useEffect, useState } from 'react'; | |
import './App.css'; | |
import { fetchRestaurants } from './utils'; | |
import Restaurants from './Restaurants'; | |
function App() { | |
const [restaurants, setRestaurants] = useState(null) | |
useEffect(()=>{ | |
fetchRestaurants() | |
.then(setRestaurants) |
import React from 'react'; | |
import { render } from '@testing-library/react'; | |
import App from '../App'; | |
import Restaurants from '../Restaurants' | |
import {fetchRestaurants} from '../utils' | |
import * as fixtures from '../fixtures' | |
import { act } from 'react-dom/test-utils'; | |
// First mock whole '../Restaurants' and '../utils' | |
// By default it will mock all the functions in module to return undefined |
# this command is necessary to tell Systemd to load our new config file | |
elspeth@server:$ sudo systemctl daemon-reload | |
# this command tells Systemd to always load our service on boot | |
elspeth@server:$ sudo systemctl enable gunicorn-superlists-staging.ottg.eu | |
# this command actually starts our service | |
elspeth@server:$ sudo systemctl start gunicorn-superlists-staging.ottg.eu | |
# Check the Systemd logs for using |