mirror of
https://github.com/sasjs/adapter.git
synced 2026-01-11 06:10:05 +00:00
fix: jest tests RequestClient.spec.ts
This commit is contained in:
@@ -1,7 +1,15 @@
|
||||
import express = require('express')
|
||||
import cors from 'cors'
|
||||
|
||||
export const app = express()
|
||||
|
||||
app.use(
|
||||
cors({
|
||||
origin: 'http://localhost', // Allow requests only from this origin
|
||||
credentials: true // Allow credentials (cookies, auth headers, etc.)
|
||||
})
|
||||
)
|
||||
|
||||
export const mockedAuthResponse = {
|
||||
access_token: 'access_token',
|
||||
token_type: 'bearer',
|
||||
@@ -12,11 +20,11 @@ export const mockedAuthResponse = {
|
||||
jti: 'jti'
|
||||
}
|
||||
|
||||
app.get('/', function (req: any, res: any) {
|
||||
app.get('/', (req: any, res: any) => {
|
||||
res.send('Hello World')
|
||||
})
|
||||
|
||||
app.post('/SASLogon/oauth/token', function (req: any, res: any) {
|
||||
app.post('/SASLogon/oauth/token', (req: any, res: any) => {
|
||||
let valid = true
|
||||
|
||||
// capture the encoded form data
|
||||
|
||||
Reference in New Issue
Block a user