chore(multiregion): maybe this will work

This commit is contained in:
Charles Driesler
2025-01-23 16:57:43 +00:00
parent ca850399b7
commit 201fe2e3ec
4 changed files with 3 additions and 38 deletions
@@ -63,7 +63,6 @@ const { getServerInfoFactory } = require('@/modules/core/repositories/server')
const { getEventBus } = require('@/modules/shared/services/eventBus')
let sendRequest
let server
const createAppToken = createAppTokenFactory({
storeApiToken: storeApiTokenFactory({ db }),
@@ -128,7 +127,6 @@ describe('GraphQL @apps-api', () => {
before(async () => {
const ctx = await beforeEachContext()
server = ctx.server
;({ sendRequest } = await initializeTestServer(ctx))
testUser = {
name: 'Dimitrie Stefanescu',
@@ -157,10 +155,6 @@ describe('GraphQL @apps-api', () => {
])}`
})
after(async () => {
await server.close()
})
let testAppId
let testApp
@@ -138,7 +138,6 @@ const expect = chai.expect
let app
let sendRequest
let server
describe('Auth @auth', () => {
describe('Local authN & authZ (token endpoints)', () => {
@@ -160,7 +159,6 @@ describe('Auth @auth', () => {
before(async () => {
const ctx = await beforeEachContext()
server = ctx.server
app = ctx.app
;({ sendRequest } = await initializeTestServer(ctx))
@@ -173,10 +171,6 @@ describe('Auth @auth', () => {
)
})
after(async () => {
await server.close()
})
it('Should register a new user (speckle frontend)', async () => {
await request(app)
.post('/auth/local/register?challenge=test')
@@ -8,7 +8,6 @@ import {
getTotalUserCountFactory
} from '@/modules/stats/repositories/index'
import { Scopes } from '@speckle/shared'
import { Server } from 'node:http'
import { db } from '@/db/knex'
import {
createCommitByBranchIdFactory,
@@ -196,8 +195,7 @@ describe('Server stats services @stats-services', function () {
})
describe('Server stats api @stats-api', function () {
let server: Server,
sendRequest: Awaited<ReturnType<typeof initializeTestServer>>['sendRequest']
let sendRequest: Awaited<ReturnType<typeof initializeTestServer>>['sendRequest']
const adminUser = {
name: 'Dimitrie',
@@ -235,7 +233,6 @@ describe('Server stats api @stats-api', function () {
before(async function () {
this.timeout(15000)
const ctx = await beforeEachContext()
server = ctx.server
;({ sendRequest } = await initializeTestServer(ctx))
adminUser.id = await createUser(adminUser)
@@ -265,10 +262,6 @@ describe('Server stats api @stats-api', function () {
await seedDb(params)
})
after(async function () {
await server.close()
})
it('Should not get stats if user is not admin', async () => {
const res = await sendRequest(adminUser.badToken, { query: fullQuery })
expect(res.body.errors).to.exist
@@ -2,11 +2,7 @@
const expect = require('chai').expect
const assert = require('assert')
const {
beforeEachContext,
initializeTestServer,
truncateTables
} = require('@/test/hooks')
const { beforeEachContext, initializeTestServer } = require('@/test/hooks')
const { noErrors } = require('@/test/helpers')
const { Scopes, Roles } = require('@speckle/shared')
const {
@@ -26,7 +22,6 @@ const {
deleteWebhookFactory,
dispatchStreamEventFactory
} = require('@/modules/webhooks/services/webhooks')
const { Users, Streams } = require('@/modules/core/dbSchema')
const {
getStreamFactory,
createStreamFactory,
@@ -166,7 +161,7 @@ const createPersonalAccessToken = createPersonalAccessTokenFactory({
describe('Webhooks @webhooks', () => {
const getWebhook = getWebhookByIdFactory({ db })
let server, sendRequest
let sendRequest
const userOne = {
name: 'User',
@@ -191,7 +186,6 @@ describe('Webhooks @webhooks', () => {
before(async () => {
const ctx = await beforeEachContext()
server = ctx.server
;({ sendRequest } = await initializeTestServer(ctx))
userOne.id = await createUser(userOne)
@@ -201,16 +195,6 @@ describe('Webhooks @webhooks', () => {
webhookOne.streamId = streamOne.id
})
after(async () => {
await truncateTables([
Users.name,
Streams.name,
'webhooks_config',
'webhooks_events'
])
await server.close()
})
describe('Create, Read, Update, Delete Webhooks', () => {
it('Should create a webhook', async () => {
webhookOne.id = await createWebhookFactory({