I have an array by the name students and a student object
let students = []
let student = {
name: '',
rollNumber: '',
age: '',
rank: ''
}
import * as RoutingConstants from './constants/RoutingConstants'; | |
import { Route, Switch } from 'react-router-dom'; | |
import LoadingComponent from './pages/LoadingComponent'; | |
import React, { Component } from 'react'; | |
function asyncComponent(importComponent: Function, LoadingComponent: Function) { | |
class AsyncComponent extends Component { | |
constructor(props) { | |
super(props); |
import * as RoutingConstants from './constants/RoutingConstants'; | |
import { Route, Switch } from 'react-router-dom'; | |
import AboutUs from './pages/AboutUs'; | |
import Products from './pages/Products'; | |
import Homepage from './pages/Homepage'; | |
import React, { Component } from 'react';; | |
class App extends Component<{}, {}> { | |
render() { | |
return ( |
import test from 'ava'; | |
const request = require('supertest'); | |
const app = require('./../app.js'); | |
test('check status', async t => { | |
const response = await request(app) | |
.get('/status'); | |
t.is(response.status, 200); | |
t.deepEqual(response.body, { |
const app = require('./app.js'); | |
const http = require('http') | |
const server = http.createServer(app); | |
const PORT = process.env.NODE_ENV || 5000; | |
server.listen(PORT, () => { | |
console.log(`Listening to port ${PORT}`); | |
}) |
const express = require('express'); | |
const bodyParser = require('body-parser'); | |
const app = express(); | |
app.use(bodyParser.json()); | |
app.use(bodyParser.urlencoded({extended: true})) | |
app.get('/status', (req , res) => { | |
res.send({ |
import test from 'ava'; | |
function sum (a, b) { | |
return a + b; | |
} | |
test('foo is being tested', t => { | |
t.pass(); | |
}) | |
test('bar is being tested', async t => { | |
const bar = Promise.resolve('bar'); |
I have an array by the name students and a student object
let students = []
let student = {
name: '',
rollNumber: '',
age: '',
rank: ''
}