Created
November 28, 2018 14:11
-
-
Save kharandziuk/d711cbb366b41966dfca501a5b2975bf to your computer and use it in GitHub Desktop.
express-supertest-hello-world gist
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 S = require('supertest') | |
| const { expect } = require('chai') | |
| const express = require('express') | |
| const app = express() | |
| const port = 3000 | |
| app.get('/', (req, res) => res.send('Hello World!')) | |
| //app.listen(port, () => console.log(`Example app listening on port ${port}!`)) | |
| describe('server', () => { | |
| it('hello world', async () => { | |
| const { text }= await S(app).get('/') | |
| expect(text).eql('Hello World!') | |
| }) | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment