chore: moved tests folder outside src folder
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { appSendGet } from '../../../tests/utils'
|
||||
import { appSendGet } from '../../../../tests/utils'
|
||||
|
||||
describe('albumSearch requests', () => {
|
||||
it('should respond 200 to calls with term', async () => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { appSendPost } from '../../../tests/utils'
|
||||
import { appSendPost } from '../../../../tests/utils'
|
||||
|
||||
describe('login-arl requests', () => {
|
||||
it('should respond 200 to calls with arl', async () => {
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
// Taken from https://github.com/visionmedia/supertest
|
||||
|
||||
import request from 'supertest'
|
||||
import express from 'express'
|
||||
import cookieParser from 'cookie-parser'
|
||||
|
||||
describe('cookie parser', () => {
|
||||
const app = express()
|
||||
app.use(cookieParser())
|
||||
|
||||
app.get('/', (_, res) => {
|
||||
res.cookie('cookie', 'hey')
|
||||
res.send()
|
||||
})
|
||||
|
||||
app.get('/return', (req, res) => {
|
||||
if (req.cookies.cookie) res.send(req.cookies.cookie)
|
||||
else res.send(':(')
|
||||
})
|
||||
|
||||
const agent = request.agent(app)
|
||||
|
||||
it('should save cookies', done => {
|
||||
agent.get('/').expect('set-cookie', 'cookie=hey; Path=/', done)
|
||||
})
|
||||
|
||||
it('should send cookies', done => {
|
||||
agent.get('/return').expect('hey', done)
|
||||
})
|
||||
})
|
||||
@@ -1,9 +0,0 @@
|
||||
import { Application } from 'express'
|
||||
import request from 'supertest'
|
||||
import { app } from '../app'
|
||||
|
||||
export const sendGet = (app: Application) => (uri: string) => request(app).get(uri).send()
|
||||
export const sendPost = (app: Application) => (uri: string) => request(app).post(uri).send()
|
||||
|
||||
export const appSendGet = sendGet(app)
|
||||
export const appSendPost = sendPost(app)
|
||||
Reference in New Issue
Block a user