chore(server): move server tests folder (#9614)
This commit is contained in:
@@ -200,9 +200,9 @@
|
|||||||
{
|
{
|
||||||
"files": [
|
"files": [
|
||||||
"*.{spec,test,e2e,stories}.{ts,tsx}",
|
"*.{spec,test,e2e,stories}.{ts,tsx}",
|
||||||
"tests/**/*.ts",
|
"tests/**/*",
|
||||||
"packages/backend/server/tests/**/*.ts",
|
"**/__tests__/**/*",
|
||||||
"tools/**.*"
|
"tools/**/*"
|
||||||
],
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
"typescript/no-non-null-assertion": "off",
|
"typescript/no-non-null-assertion": "off",
|
||||||
|
|||||||
@@ -11,9 +11,9 @@
|
|||||||
"build": "tsc",
|
"build": "tsc",
|
||||||
"dev": "nodemon ./src/index.ts",
|
"dev": "nodemon ./src/index.ts",
|
||||||
"test": "ava --concurrency 1 --serial",
|
"test": "ava --concurrency 1 --serial",
|
||||||
"test:copilot": "ava \"tests/**/copilot-*.spec.ts\"",
|
"test:copilot": "ava \"src/__tests__/**/copilot-*.spec.ts\"",
|
||||||
"test:coverage": "c8 ava --concurrency 1 --serial",
|
"test:coverage": "c8 ava --concurrency 1 --serial",
|
||||||
"test:copilot:coverage": "c8 ava --timeout=5m \"tests/**/copilot-*.spec.ts\"",
|
"test:copilot:coverage": "c8 ava --timeout=5m \"src/__tests__/**/copilot-*.spec.ts\"",
|
||||||
"data-migration": "cross-env NODE_ENV=script r ./src/data/index.ts",
|
"data-migration": "cross-env NODE_ENV=script r ./src/data/index.ts",
|
||||||
"predeploy": "yarn prisma migrate deploy && NODE_ENV=script node --import ./scripts/register.js ./dist/data/index.js run",
|
"predeploy": "yarn prisma migrate deploy && NODE_ENV=script node --import ./scripts/register.js ./dist/data/index.js run",
|
||||||
"postinstall": "prisma generate"
|
"postinstall": "prisma generate"
|
||||||
@@ -96,6 +96,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@affine-test/kit": "workspace:*",
|
"@affine-test/kit": "workspace:*",
|
||||||
"@affine-tools/cli": "workspace:*",
|
"@affine-tools/cli": "workspace:*",
|
||||||
|
"@affine-tools/utils": "workspace:*",
|
||||||
"@affine/server-native": "workspace:*",
|
"@affine/server-native": "workspace:*",
|
||||||
"@nestjs/testing": "^10.4.15",
|
"@nestjs/testing": "^10.4.15",
|
||||||
"@types/cookie-parser": "^1.4.8",
|
"@types/cookie-parser": "^1.4.8",
|
||||||
@@ -134,8 +135,7 @@
|
|||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"**/__tests__/**/*.spec.ts",
|
"**/__tests__/**/*.spec.ts",
|
||||||
"tests/**/*.spec.ts",
|
"**/__tests__/**/*.e2e.ts"
|
||||||
"tests/**/*.e2e.ts"
|
|
||||||
],
|
],
|
||||||
"require": [
|
"require": [
|
||||||
"./src/prelude.ts"
|
"./src/prelude.ts"
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import type { TestFn } from 'ava';
|
|||||||
import ava from 'ava';
|
import ava from 'ava';
|
||||||
import request from 'supertest';
|
import request from 'supertest';
|
||||||
|
|
||||||
import { buildAppModule } from '../../src/app.module';
|
import { buildAppModule } from '../../app.module';
|
||||||
import { createTestingApp } from '../utils';
|
import { createTestingApp } from '../utils';
|
||||||
|
|
||||||
const gql = '/graphql';
|
const gql = '/graphql';
|
||||||
@@ -3,7 +3,7 @@ import type { TestFn } from 'ava';
|
|||||||
import ava from 'ava';
|
import ava from 'ava';
|
||||||
import request from 'supertest';
|
import request from 'supertest';
|
||||||
|
|
||||||
import { buildAppModule } from '../../src/app.module';
|
import { buildAppModule } from '../../app.module';
|
||||||
import { createTestingApp } from '../utils';
|
import { createTestingApp } from '../utils';
|
||||||
|
|
||||||
const test = ava as TestFn<{
|
const test = ava as TestFn<{
|
||||||
@@ -7,9 +7,9 @@ import type { TestFn } from 'ava';
|
|||||||
import ava from 'ava';
|
import ava from 'ava';
|
||||||
import request from 'supertest';
|
import request from 'supertest';
|
||||||
|
|
||||||
import { buildAppModule } from '../../src/app.module';
|
import { buildAppModule } from '../../app.module';
|
||||||
import { Config } from '../../src/base';
|
import { Config } from '../../base';
|
||||||
import { ServerService } from '../../src/core/config';
|
import { ServerService } from '../../core/config';
|
||||||
import { createTestingApp, initTestingDB } from '../utils';
|
import { createTestingApp, initTestingDB } from '../utils';
|
||||||
|
|
||||||
const test = ava as TestFn<{
|
const test = ava as TestFn<{
|
||||||
@@ -3,7 +3,7 @@ import type { TestFn } from 'ava';
|
|||||||
import ava from 'ava';
|
import ava from 'ava';
|
||||||
import request from 'supertest';
|
import request from 'supertest';
|
||||||
|
|
||||||
import { buildAppModule } from '../../src/app.module';
|
import { buildAppModule } from '../../app.module';
|
||||||
import { createTestingApp } from '../utils';
|
import { createTestingApp } from '../utils';
|
||||||
|
|
||||||
const test = ava as TestFn<{
|
const test = ava as TestFn<{
|
||||||
@@ -8,8 +8,8 @@ import type { INestApplication } from '@nestjs/common';
|
|||||||
import type { TestFn } from 'ava';
|
import type { TestFn } from 'ava';
|
||||||
import ava from 'ava';
|
import ava from 'ava';
|
||||||
|
|
||||||
import { MailService } from '../../src/base/mailer';
|
import { MailService } from '../../base/mailer';
|
||||||
import { AuthService } from '../../src/core/auth/service';
|
import { AuthService } from '../../core/auth/service';
|
||||||
import {
|
import {
|
||||||
changeEmail,
|
changeEmail,
|
||||||
changePassword,
|
changePassword,
|
||||||
@@ -4,11 +4,11 @@ import ava, { TestFn } from 'ava';
|
|||||||
import Sinon from 'sinon';
|
import Sinon from 'sinon';
|
||||||
import request from 'supertest';
|
import request from 'supertest';
|
||||||
|
|
||||||
import { MailService } from '../../src/base';
|
import { MailService } from '../../base';
|
||||||
import { AuthModule, CurrentUser } from '../../src/core/auth';
|
import { AuthModule, CurrentUser } from '../../core/auth';
|
||||||
import { AuthService } from '../../src/core/auth/service';
|
import { AuthService } from '../../core/auth/service';
|
||||||
import { FeatureModule } from '../../src/core/features';
|
import { FeatureModule } from '../../core/features';
|
||||||
import { UserModule, UserService } from '../../src/core/user';
|
import { UserModule, UserService } from '../../core/user';
|
||||||
import { createTestingApp, getSession, sessionCookie } from '../utils';
|
import { createTestingApp, getSession, sessionCookie } from '../utils';
|
||||||
|
|
||||||
const test = ava as TestFn<{
|
const test = ava as TestFn<{
|
||||||
@@ -4,8 +4,8 @@ import ava, { TestFn } from 'ava';
|
|||||||
import Sinon from 'sinon';
|
import Sinon from 'sinon';
|
||||||
import request from 'supertest';
|
import request from 'supertest';
|
||||||
|
|
||||||
import { AuthModule, CurrentUser, Public, Session } from '../../src/core/auth';
|
import { AuthModule, CurrentUser, Public, Session } from '../../core/auth';
|
||||||
import { AuthService } from '../../src/core/auth/service';
|
import { AuthService } from '../../core/auth/service';
|
||||||
import { createTestingApp } from '../utils';
|
import { createTestingApp } from '../utils';
|
||||||
|
|
||||||
@Controller('/')
|
@Controller('/')
|
||||||
@@ -2,11 +2,11 @@ import { TestingModule } from '@nestjs/testing';
|
|||||||
import { PrismaClient } from '@prisma/client';
|
import { PrismaClient } from '@prisma/client';
|
||||||
import ava, { TestFn } from 'ava';
|
import ava, { TestFn } from 'ava';
|
||||||
|
|
||||||
import { CurrentUser } from '../../src/core/auth';
|
import { CurrentUser } from '../../core/auth';
|
||||||
import { AuthService } from '../../src/core/auth/service';
|
import { AuthService } from '../../core/auth/service';
|
||||||
import { FeatureModule } from '../../src/core/features';
|
import { FeatureModule } from '../../core/features';
|
||||||
import { QuotaModule } from '../../src/core/quota';
|
import { QuotaModule } from '../../core/quota';
|
||||||
import { UserModule, UserService } from '../../src/core/user';
|
import { UserModule, UserService } from '../../core/user';
|
||||||
import { createTestingModule, initTestingDB } from '../utils';
|
import { createTestingModule, initTestingDB } from '../utils';
|
||||||
|
|
||||||
const test = ava as TestFn<{
|
const test = ava as TestFn<{
|
||||||
@@ -2,7 +2,7 @@ import { TestingModule } from '@nestjs/testing';
|
|||||||
import { PrismaClient } from '@prisma/client';
|
import { PrismaClient } from '@prisma/client';
|
||||||
import ava, { TestFn } from 'ava';
|
import ava, { TestFn } from 'ava';
|
||||||
|
|
||||||
import { TokenService, TokenType } from '../../src/core/auth';
|
import { TokenService, TokenType } from '../../core/auth';
|
||||||
import { createTestingModule } from '../utils';
|
import { createTestingModule } from '../utils';
|
||||||
|
|
||||||
const test = ava as TestFn<{
|
const test = ava as TestFn<{
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import { TestingModule } from '@nestjs/testing';
|
import { TestingModule } from '@nestjs/testing';
|
||||||
import test from 'ava';
|
import test from 'ava';
|
||||||
|
|
||||||
import { Cache } from '../src/base/cache';
|
import { Cache } from '../base/cache';
|
||||||
import { createTestingModule } from './utils';
|
import { createTestingModule } from './utils';
|
||||||
|
|
||||||
let cache: Cache;
|
let cache: Cache;
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import { TestingModule } from '@nestjs/testing';
|
import { TestingModule } from '@nestjs/testing';
|
||||||
import test from 'ava';
|
import test from 'ava';
|
||||||
|
|
||||||
import { Config, ConfigModule } from '../src/base/config';
|
import { Config, ConfigModule } from '../base/config';
|
||||||
import { createTestingModule } from './utils';
|
import { createTestingModule } from './utils';
|
||||||
|
|
||||||
let config: Config;
|
let config: Config;
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
/// <reference types="../src/global.d.ts" />
|
/// <reference types="../global.d.ts" />
|
||||||
|
|
||||||
import { TestingModule } from '@nestjs/testing';
|
import { TestingModule } from '@nestjs/testing';
|
||||||
import type { ExecutionContext, TestFn } from 'ava';
|
import type { ExecutionContext, TestFn } from 'ava';
|
||||||
import ava from 'ava';
|
import ava from 'ava';
|
||||||
|
|
||||||
import { ConfigModule } from '../src/base/config';
|
import { ConfigModule } from '../base/config';
|
||||||
import { AuthService } from '../src/core/auth';
|
import { AuthService } from '../core/auth';
|
||||||
import { QuotaModule } from '../src/core/quota';
|
import { QuotaModule } from '../core/quota';
|
||||||
import { CopilotModule } from '../src/plugins/copilot';
|
import { CopilotModule } from '../plugins/copilot';
|
||||||
import { prompts, PromptService } from '../src/plugins/copilot/prompt';
|
import { prompts, PromptService } from '../plugins/copilot/prompt';
|
||||||
import {
|
import {
|
||||||
CopilotProviderService,
|
CopilotProviderService,
|
||||||
FalProvider,
|
FalProvider,
|
||||||
@@ -16,17 +16,17 @@ import {
|
|||||||
PerplexityProvider,
|
PerplexityProvider,
|
||||||
registerCopilotProvider,
|
registerCopilotProvider,
|
||||||
unregisterCopilotProvider,
|
unregisterCopilotProvider,
|
||||||
} from '../src/plugins/copilot/providers';
|
} from '../plugins/copilot/providers';
|
||||||
import {
|
import {
|
||||||
CopilotChatTextExecutor,
|
CopilotChatTextExecutor,
|
||||||
CopilotWorkflowService,
|
CopilotWorkflowService,
|
||||||
GraphExecutorState,
|
GraphExecutorState,
|
||||||
} from '../src/plugins/copilot/workflow';
|
} from '../plugins/copilot/workflow';
|
||||||
import {
|
import {
|
||||||
CopilotChatImageExecutor,
|
CopilotChatImageExecutor,
|
||||||
CopilotCheckHtmlExecutor,
|
CopilotCheckHtmlExecutor,
|
||||||
CopilotCheckJsonExecutor,
|
CopilotCheckJsonExecutor,
|
||||||
} from '../src/plugins/copilot/workflow/executor';
|
} from '../plugins/copilot/workflow/executor';
|
||||||
import { createTestingModule } from './utils';
|
import { createTestingModule } from './utils';
|
||||||
import { TestAssets } from './utils/copilot';
|
import { TestAssets } from './utils/copilot';
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
/// <reference types="../src/global.d.ts" />
|
/// <reference types="../global.d.ts" />
|
||||||
|
|
||||||
import { randomUUID } from 'node:crypto';
|
import { randomUUID } from 'node:crypto';
|
||||||
|
|
||||||
@@ -7,11 +7,11 @@ import type { TestFn } from 'ava';
|
|||||||
import ava from 'ava';
|
import ava from 'ava';
|
||||||
import Sinon from 'sinon';
|
import Sinon from 'sinon';
|
||||||
|
|
||||||
import { ConfigModule } from '../src/base/config';
|
import { ConfigModule } from '../base/config';
|
||||||
import { AuthService } from '../src/core/auth';
|
import { AuthService } from '../core/auth';
|
||||||
import { WorkspaceModule } from '../src/core/workspaces';
|
import { WorkspaceModule } from '../core/workspaces';
|
||||||
import { CopilotModule } from '../src/plugins/copilot';
|
import { CopilotModule } from '../plugins/copilot';
|
||||||
import { prompts, PromptService } from '../src/plugins/copilot/prompt';
|
import { prompts, PromptService } from '../plugins/copilot/prompt';
|
||||||
import {
|
import {
|
||||||
CopilotProviderService,
|
CopilotProviderService,
|
||||||
FalProvider,
|
FalProvider,
|
||||||
@@ -19,8 +19,8 @@ import {
|
|||||||
PerplexityProvider,
|
PerplexityProvider,
|
||||||
registerCopilotProvider,
|
registerCopilotProvider,
|
||||||
unregisterCopilotProvider,
|
unregisterCopilotProvider,
|
||||||
} from '../src/plugins/copilot/providers';
|
} from '../plugins/copilot/providers';
|
||||||
import { CopilotStorage } from '../src/plugins/copilot/storage';
|
import { CopilotStorage } from '../plugins/copilot/storage';
|
||||||
import {
|
import {
|
||||||
acceptInviteById,
|
acceptInviteById,
|
||||||
createTestingApp,
|
createTestingApp,
|
||||||
@@ -1,27 +1,27 @@
|
|||||||
/// <reference types="../src/global.d.ts" />
|
/// <reference types="../global.d.ts" />
|
||||||
|
|
||||||
import { TestingModule } from '@nestjs/testing';
|
import { TestingModule } from '@nestjs/testing';
|
||||||
import type { TestFn } from 'ava';
|
import type { TestFn } from 'ava';
|
||||||
import ava from 'ava';
|
import ava from 'ava';
|
||||||
import Sinon from 'sinon';
|
import Sinon from 'sinon';
|
||||||
|
|
||||||
import { ConfigModule } from '../src/base/config';
|
import { ConfigModule } from '../base/config';
|
||||||
import { AuthService } from '../src/core/auth';
|
import { AuthService } from '../core/auth';
|
||||||
import { QuotaModule } from '../src/core/quota';
|
import { QuotaModule } from '../core/quota';
|
||||||
import { CopilotModule } from '../src/plugins/copilot';
|
import { CopilotModule } from '../plugins/copilot';
|
||||||
import { prompts, PromptService } from '../src/plugins/copilot/prompt';
|
import { prompts, PromptService } from '../plugins/copilot/prompt';
|
||||||
import {
|
import {
|
||||||
CopilotProviderService,
|
CopilotProviderService,
|
||||||
OpenAIProvider,
|
OpenAIProvider,
|
||||||
registerCopilotProvider,
|
registerCopilotProvider,
|
||||||
unregisterCopilotProvider,
|
unregisterCopilotProvider,
|
||||||
} from '../src/plugins/copilot/providers';
|
} from '../plugins/copilot/providers';
|
||||||
import { CitationParser } from '../src/plugins/copilot/providers/perplexity';
|
import { CitationParser } from '../plugins/copilot/providers/perplexity';
|
||||||
import { ChatSessionService } from '../src/plugins/copilot/session';
|
import { ChatSessionService } from '../plugins/copilot/session';
|
||||||
import {
|
import {
|
||||||
CopilotCapability,
|
CopilotCapability,
|
||||||
CopilotProviderType,
|
CopilotProviderType,
|
||||||
} from '../src/plugins/copilot/types';
|
} from '../plugins/copilot/types';
|
||||||
import {
|
import {
|
||||||
CopilotChatTextExecutor,
|
CopilotChatTextExecutor,
|
||||||
CopilotWorkflowService,
|
CopilotWorkflowService,
|
||||||
@@ -30,7 +30,7 @@ import {
|
|||||||
WorkflowGraphExecutor,
|
WorkflowGraphExecutor,
|
||||||
type WorkflowNodeData,
|
type WorkflowNodeData,
|
||||||
WorkflowNodeType,
|
WorkflowNodeType,
|
||||||
} from '../src/plugins/copilot/workflow';
|
} from '../plugins/copilot/workflow';
|
||||||
import {
|
import {
|
||||||
CopilotChatImageExecutor,
|
CopilotChatImageExecutor,
|
||||||
CopilotCheckHtmlExecutor,
|
CopilotCheckHtmlExecutor,
|
||||||
@@ -38,9 +38,9 @@ import {
|
|||||||
getWorkflowExecutor,
|
getWorkflowExecutor,
|
||||||
NodeExecuteState,
|
NodeExecuteState,
|
||||||
NodeExecutorType,
|
NodeExecutorType,
|
||||||
} from '../src/plugins/copilot/workflow/executor';
|
} from '../plugins/copilot/workflow/executor';
|
||||||
import { AutoRegisteredWorkflowExecutor } from '../src/plugins/copilot/workflow/executor/utils';
|
import { AutoRegisteredWorkflowExecutor } from '../plugins/copilot/workflow/executor/utils';
|
||||||
import { WorkflowGraphList } from '../src/plugins/copilot/workflow/graph';
|
import { WorkflowGraphList } from '../plugins/copilot/workflow/graph';
|
||||||
import { createTestingModule } from './utils';
|
import { createTestingModule } from './utils';
|
||||||
import { MockCopilotTestProvider, WorkflowTestCases } from './utils/copilot';
|
import { MockCopilotTestProvider, WorkflowTestCases } from './utils/copilot';
|
||||||
|
|
||||||
@@ -6,9 +6,9 @@ import { PrismaClient } from '@prisma/client';
|
|||||||
import test from 'ava';
|
import test from 'ava';
|
||||||
import * as Sinon from 'sinon';
|
import * as Sinon from 'sinon';
|
||||||
|
|
||||||
import { Config } from '../../src/base/config';
|
import { Config } from '../../base/config';
|
||||||
import { DocStorageModule } from '../../src/core/doc';
|
import { DocStorageModule } from '../../core/doc';
|
||||||
import { DocStorageCronJob } from '../../src/core/doc/job';
|
import { DocStorageCronJob } from '../../core/doc/job';
|
||||||
import { createTestingModule } from '../utils';
|
import { createTestingModule } from '../utils';
|
||||||
|
|
||||||
let m: TestingModule;
|
let m: TestingModule;
|
||||||
@@ -4,12 +4,9 @@ import { PrismaClient } from '@prisma/client';
|
|||||||
import test from 'ava';
|
import test from 'ava';
|
||||||
import * as Sinon from 'sinon';
|
import * as Sinon from 'sinon';
|
||||||
|
|
||||||
import {
|
import { DocStorageModule, PgWorkspaceDocStorageAdapter } from '../../core/doc';
|
||||||
DocStorageModule,
|
import { DocStorageOptions } from '../../core/doc/options';
|
||||||
PgWorkspaceDocStorageAdapter,
|
import { DocRecord } from '../../core/doc/storage';
|
||||||
} from '../../src/core/doc';
|
|
||||||
import { DocStorageOptions } from '../../src/core/doc/options';
|
|
||||||
import { DocRecord } from '../../src/core/doc/storage';
|
|
||||||
import { createTestingModule, initTestingDB } from '../utils';
|
import { createTestingModule, initTestingDB } from '../utils';
|
||||||
|
|
||||||
let m: TestingModule;
|
let m: TestingModule;
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
import { mkdirSync, writeFileSync } from 'node:fs';
|
import { mkdirSync, writeFileSync } from 'node:fs';
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import { fileURLToPath } from 'node:url';
|
|
||||||
|
|
||||||
|
import { Package } from '@affine-tools/utils/workspace';
|
||||||
import type { INestApplication } from '@nestjs/common';
|
import type { INestApplication } from '@nestjs/common';
|
||||||
import { PrismaClient } from '@prisma/client';
|
import { PrismaClient } from '@prisma/client';
|
||||||
import type { TestFn } from 'ava';
|
import type { TestFn } from 'ava';
|
||||||
import ava from 'ava';
|
import ava from 'ava';
|
||||||
import request from 'supertest';
|
import request from 'supertest';
|
||||||
|
|
||||||
import { DocRendererModule } from '../../src/core/doc-renderer';
|
import { DocRendererModule } from '../../core/doc-renderer';
|
||||||
import { createTestingApp } from '../utils';
|
import { createTestingApp } from '../utils';
|
||||||
|
|
||||||
const test = ava as TestFn<{
|
const test = ava as TestFn<{
|
||||||
@@ -48,10 +48,7 @@ function initTestStaticFiles(staticPath: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
test.before('init selfhost server', async t => {
|
test.before('init selfhost server', async t => {
|
||||||
const staticPath = path.join(
|
const staticPath = new Package('@affine/server').join('static').value;
|
||||||
fileURLToPath(import.meta.url),
|
|
||||||
'../../../static'
|
|
||||||
);
|
|
||||||
initTestStaticFiles(staticPath);
|
initTestStaticFiles(staticPath);
|
||||||
|
|
||||||
const { app } = await createTestingApp({
|
const { app } = await createTestingApp({
|
||||||
@@ -4,11 +4,11 @@ import test from 'ava';
|
|||||||
import * as Sinon from 'sinon';
|
import * as Sinon from 'sinon';
|
||||||
import { applyUpdate, Doc as YDoc, encodeStateAsUpdate } from 'yjs';
|
import { applyUpdate, Doc as YDoc, encodeStateAsUpdate } from 'yjs';
|
||||||
|
|
||||||
import { ConfigModule } from '../../src/base/config';
|
import { ConfigModule } from '../../base/config';
|
||||||
import {
|
import {
|
||||||
DocStorageModule,
|
DocStorageModule,
|
||||||
PgWorkspaceDocStorageAdapter as Adapter,
|
PgWorkspaceDocStorageAdapter as Adapter,
|
||||||
} from '../../src/core/doc';
|
} from '../../core/doc';
|
||||||
import { createTestingModule, initTestingDB } from '../utils';
|
import { createTestingModule, initTestingDB } from '../utils';
|
||||||
|
|
||||||
let m: TestingModule;
|
let m: TestingModule;
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
/// <reference types="../src/global.d.ts" />
|
/// <reference types="../global.d.ts" />
|
||||||
|
|
||||||
import { INestApplication } from '@nestjs/common';
|
import { INestApplication } from '@nestjs/common';
|
||||||
import type { TestFn } from 'ava';
|
import type { TestFn } from 'ava';
|
||||||
import ava from 'ava';
|
import ava from 'ava';
|
||||||
|
|
||||||
import { Runtime } from '../src/base';
|
import { Runtime } from '../base';
|
||||||
import { AuthService } from '../src/core/auth/service';
|
import { AuthService } from '../core/auth/service';
|
||||||
import {
|
import {
|
||||||
FeatureManagementService,
|
FeatureManagementService,
|
||||||
FeatureModule,
|
FeatureModule,
|
||||||
FeatureService,
|
FeatureService,
|
||||||
FeatureType,
|
FeatureType,
|
||||||
} from '../src/core/features';
|
} from '../core/features';
|
||||||
import { WorkspaceResolver } from '../src/core/workspaces/resolvers';
|
import { WorkspaceResolver } from '../core/workspaces/resolvers';
|
||||||
import { createTestingApp } from './utils';
|
import { createTestingApp } from './utils';
|
||||||
import { WorkspaceResolverMock } from './utils/feature';
|
import { WorkspaceResolverMock } from './utils/feature';
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
/// <reference types="../src/global.d.ts" />
|
/// <reference types="../global.d.ts" />
|
||||||
// This test case is for testing the mailer service.
|
// This test case is for testing the mailer service.
|
||||||
// Please use local SMTP server for testing.
|
// Please use local SMTP server for testing.
|
||||||
// See: https://github.com/mailhog/MailHog
|
// See: https://github.com/mailhog/MailHog
|
||||||
@@ -10,8 +10,8 @@ import { TestingModule } from '@nestjs/testing';
|
|||||||
import type { TestFn } from 'ava';
|
import type { TestFn } from 'ava';
|
||||||
import ava from 'ava';
|
import ava from 'ava';
|
||||||
|
|
||||||
import { ConfigModule } from '../src/base/config';
|
import { ConfigModule } from '../base/config';
|
||||||
import { AuthService } from '../src/core/auth/service';
|
import { AuthService } from '../core/auth/service';
|
||||||
import { createTestingModule } from './utils';
|
import { createTestingModule } from './utils';
|
||||||
|
|
||||||
const test = ava as TestFn<{
|
const test = ava as TestFn<{
|
||||||
@@ -3,9 +3,9 @@ import type { TestFn } from 'ava';
|
|||||||
import ava from 'ava';
|
import ava from 'ava';
|
||||||
import Sinon from 'sinon';
|
import Sinon from 'sinon';
|
||||||
|
|
||||||
import { AppModule } from '../src/app.module';
|
import { AppModule } from '../app.module';
|
||||||
import { MailService } from '../src/base/mailer';
|
import { MailService } from '../base/mailer';
|
||||||
import { FeatureManagementService } from '../src/core/features';
|
import { FeatureManagementService } from '../core/features';
|
||||||
import { createTestingApp, createWorkspace, inviteUser, signUp } from './utils';
|
import { createTestingApp, createWorkspace, inviteUser, signUp } from './utils';
|
||||||
const test = ava as TestFn<{
|
const test = ava as TestFn<{
|
||||||
app: INestApplication;
|
app: INestApplication;
|
||||||
@@ -4,9 +4,9 @@ import { PrismaClient } from '@prisma/client';
|
|||||||
import ava, { TestFn } from 'ava';
|
import ava, { TestFn } from 'ava';
|
||||||
import Sinon from 'sinon';
|
import Sinon from 'sinon';
|
||||||
|
|
||||||
import { EmailAlreadyUsed } from '../../src/base';
|
import { EmailAlreadyUsed } from '../../base';
|
||||||
import { Permission } from '../../src/core/permission';
|
import { Permission } from '../../core/permission';
|
||||||
import { UserModel } from '../../src/models/user';
|
import { UserModel } from '../../models/user';
|
||||||
import { createTestingModule, initTestingDB } from '../utils';
|
import { createTestingModule, initTestingDB } from '../utils';
|
||||||
|
|
||||||
interface Context {
|
interface Context {
|
||||||
@@ -4,8 +4,8 @@ import { TestingModule } from '@nestjs/testing';
|
|||||||
import ava, { TestFn } from 'ava';
|
import ava, { TestFn } from 'ava';
|
||||||
import Sinon from 'sinon';
|
import Sinon from 'sinon';
|
||||||
|
|
||||||
import { Locker, Mutex } from '../src/base/mutex';
|
import { Locker, Mutex } from '../base/mutex';
|
||||||
import { SessionRedis } from '../src/base/redis';
|
import { SessionRedis } from '../base/redis';
|
||||||
import { createTestingModule, sleep } from './utils';
|
import { createTestingModule, sleep } from './utils';
|
||||||
|
|
||||||
const test = ava as TestFn<{
|
const test = ava as TestFn<{
|
||||||
@@ -20,8 +20,8 @@ import {
|
|||||||
AccessDenied,
|
AccessDenied,
|
||||||
GatewayErrorWrapper,
|
GatewayErrorWrapper,
|
||||||
UserFriendlyError,
|
UserFriendlyError,
|
||||||
} from '../../src/base';
|
} from '../../base';
|
||||||
import { Public } from '../../src/core/auth';
|
import { Public } from '../../core/auth';
|
||||||
import { createTestingApp } from '../utils';
|
import { createTestingApp } from '../utils';
|
||||||
|
|
||||||
@Public()
|
@Public()
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import '../../src/plugins/config';
|
import '../../plugins/config';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Controller,
|
Controller,
|
||||||
@@ -12,15 +12,15 @@ import ava, { TestFn } from 'ava';
|
|||||||
import Sinon from 'sinon';
|
import Sinon from 'sinon';
|
||||||
import request, { type Response } from 'supertest';
|
import request, { type Response } from 'supertest';
|
||||||
|
|
||||||
import { AppModule } from '../../src/app.module';
|
import { AppModule } from '../../app.module';
|
||||||
import { ConfigModule } from '../../src/base/config';
|
import { ConfigModule } from '../../base/config';
|
||||||
import {
|
import {
|
||||||
CloudThrottlerGuard,
|
CloudThrottlerGuard,
|
||||||
SkipThrottle,
|
SkipThrottle,
|
||||||
Throttle,
|
Throttle,
|
||||||
ThrottlerStorage,
|
ThrottlerStorage,
|
||||||
} from '../../src/base/throttler';
|
} from '../../base/throttler';
|
||||||
import { AuthService, Public } from '../../src/core/auth';
|
import { AuthService, Public } from '../../core/auth';
|
||||||
import { createTestingApp, initTestingDB, internalSignIn } from '../utils';
|
import { createTestingApp, initTestingDB, internalSignIn } from '../utils';
|
||||||
|
|
||||||
const test = ava as TestFn<{
|
const test = ava as TestFn<{
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import '../../src/plugins/config';
|
import '../../plugins/config';
|
||||||
|
|
||||||
import { HttpStatus, INestApplication } from '@nestjs/common';
|
import { HttpStatus, INestApplication } from '@nestjs/common';
|
||||||
import { PrismaClient } from '@prisma/client';
|
import { PrismaClient } from '@prisma/client';
|
||||||
@@ -6,15 +6,15 @@ import ava, { TestFn } from 'ava';
|
|||||||
import Sinon from 'sinon';
|
import Sinon from 'sinon';
|
||||||
import request from 'supertest';
|
import request from 'supertest';
|
||||||
|
|
||||||
import { AppModule } from '../../src/app.module';
|
import { AppModule } from '../../app.module';
|
||||||
import { URLHelper } from '../../src/base';
|
import { URLHelper } from '../../base';
|
||||||
import { ConfigModule } from '../../src/base/config';
|
import { ConfigModule } from '../../base/config';
|
||||||
import { CurrentUser } from '../../src/core/auth';
|
import { CurrentUser } from '../../core/auth';
|
||||||
import { AuthService } from '../../src/core/auth/service';
|
import { AuthService } from '../../core/auth/service';
|
||||||
import { UserService } from '../../src/core/user';
|
import { UserService } from '../../core/user';
|
||||||
import { OAuthProviderName } from '../../src/plugins/oauth/config';
|
import { OAuthProviderName } from '../../plugins/oauth/config';
|
||||||
import { GoogleOAuthProvider } from '../../src/plugins/oauth/providers/google';
|
import { GoogleOAuthProvider } from '../../plugins/oauth/providers/google';
|
||||||
import { OAuthService } from '../../src/plugins/oauth/service';
|
import { OAuthService } from '../../plugins/oauth/service';
|
||||||
import { createTestingApp, getSession, initTestingDB } from '../utils';
|
import { createTestingApp, getSession, initTestingDB } from '../utils';
|
||||||
|
|
||||||
const test = ava as TestFn<{
|
const test = ava as TestFn<{
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
# Snapshot report for `tests/payment/service.spec.ts`
|
# Snapshot report for `src/__tests__/payment/service.spec.ts`
|
||||||
|
|
||||||
The actual snapshot is saved in `service.spec.ts.snap`.
|
The actual snapshot is saved in `service.spec.ts.snap`.
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import '../../src/plugins/payment';
|
import '../../plugins/payment';
|
||||||
|
|
||||||
import { INestApplication } from '@nestjs/common';
|
import { INestApplication } from '@nestjs/common';
|
||||||
import { PrismaClient } from '@prisma/client';
|
import { PrismaClient } from '@prisma/client';
|
||||||
@@ -6,16 +6,13 @@ import ava, { TestFn } from 'ava';
|
|||||||
import Sinon from 'sinon';
|
import Sinon from 'sinon';
|
||||||
import Stripe from 'stripe';
|
import Stripe from 'stripe';
|
||||||
|
|
||||||
import { AppModule } from '../../src/app.module';
|
import { AppModule } from '../../app.module';
|
||||||
import { EventEmitter, Runtime } from '../../src/base';
|
import { EventEmitter, Runtime } from '../../base';
|
||||||
import { ConfigModule } from '../../src/base/config';
|
import { ConfigModule } from '../../base/config';
|
||||||
import { CurrentUser } from '../../src/core/auth';
|
import { CurrentUser } from '../../core/auth';
|
||||||
import { AuthService } from '../../src/core/auth/service';
|
import { AuthService } from '../../core/auth/service';
|
||||||
import {
|
import { EarlyAccessType, FeatureManagementService } from '../../core/features';
|
||||||
EarlyAccessType,
|
import { SubscriptionService } from '../../plugins/payment/service';
|
||||||
FeatureManagementService,
|
|
||||||
} from '../../src/core/features';
|
|
||||||
import { SubscriptionService } from '../../src/plugins/payment/service';
|
|
||||||
import {
|
import {
|
||||||
CouponType,
|
CouponType,
|
||||||
encodeLookupKey,
|
encodeLookupKey,
|
||||||
@@ -23,7 +20,7 @@ import {
|
|||||||
SubscriptionRecurring,
|
SubscriptionRecurring,
|
||||||
SubscriptionStatus,
|
SubscriptionStatus,
|
||||||
SubscriptionVariant,
|
SubscriptionVariant,
|
||||||
} from '../../src/plugins/payment/types';
|
} from '../../plugins/payment/types';
|
||||||
import { createTestingApp, initTestingDB } from '../utils';
|
import { createTestingApp, initTestingDB } from '../utils';
|
||||||
|
|
||||||
const PRO_MONTHLY = `${SubscriptionPlan.Pro}_${SubscriptionRecurring.Monthly}`;
|
const PRO_MONTHLY = `${SubscriptionPlan.Pro}_${SubscriptionRecurring.Monthly}`;
|
||||||
@@ -1,20 +1,20 @@
|
|||||||
/// <reference types="../src/global.d.ts" />
|
/// <reference types="../global.d.ts" />
|
||||||
|
|
||||||
import { TestingModule } from '@nestjs/testing';
|
import { TestingModule } from '@nestjs/testing';
|
||||||
import type { TestFn } from 'ava';
|
import type { TestFn } from 'ava';
|
||||||
import ava from 'ava';
|
import ava from 'ava';
|
||||||
|
|
||||||
import { AuthService } from '../src/core/auth';
|
import { AuthService } from '../core/auth';
|
||||||
import {
|
import {
|
||||||
QuotaManagementService,
|
QuotaManagementService,
|
||||||
QuotaModule,
|
QuotaModule,
|
||||||
QuotaService,
|
QuotaService,
|
||||||
QuotaType,
|
QuotaType,
|
||||||
} from '../src/core/quota';
|
} from '../core/quota';
|
||||||
import { OneGB, OneMB } from '../src/core/quota/constant';
|
import { OneGB, OneMB } from '../core/quota/constant';
|
||||||
import { FreePlan, ProPlan } from '../src/core/quota/schema';
|
import { FreePlan, ProPlan } from '../core/quota/schema';
|
||||||
import { StorageModule, WorkspaceBlobStorage } from '../src/core/storage';
|
import { StorageModule, WorkspaceBlobStorage } from '../core/storage';
|
||||||
import { WorkspaceResolver } from '../src/core/workspaces/resolvers';
|
import { WorkspaceResolver } from '../core/workspaces/resolvers';
|
||||||
import { createTestingModule } from './utils';
|
import { createTestingModule } from './utils';
|
||||||
import { WorkspaceResolverMock } from './utils/feature';
|
import { WorkspaceResolverMock } from './utils/feature';
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
/// <reference types="../src/global.d.ts" />
|
/// <reference types="../global.d.ts" />
|
||||||
|
|
||||||
import { randomUUID } from 'node:crypto';
|
import { randomUUID } from 'node:crypto';
|
||||||
|
|
||||||
@@ -9,17 +9,13 @@ import type { TestFn } from 'ava';
|
|||||||
import ava from 'ava';
|
import ava from 'ava';
|
||||||
import Sinon from 'sinon';
|
import Sinon from 'sinon';
|
||||||
|
|
||||||
import { AppModule } from '../src/app.module';
|
import { AppModule } from '../app.module';
|
||||||
import { EventEmitter } from '../src/base';
|
import { EventEmitter } from '../base';
|
||||||
import { AuthService } from '../src/core/auth';
|
import { AuthService } from '../core/auth';
|
||||||
import { DocContentService } from '../src/core/doc-renderer';
|
import { DocContentService } from '../core/doc-renderer';
|
||||||
import { Permission, PermissionService } from '../src/core/permission';
|
import { Permission, PermissionService } from '../core/permission';
|
||||||
import {
|
import { QuotaManagementService, QuotaService, QuotaType } from '../core/quota';
|
||||||
QuotaManagementService,
|
import { WorkspaceType } from '../core/workspaces';
|
||||||
QuotaService,
|
|
||||||
QuotaType,
|
|
||||||
} from '../src/core/quota';
|
|
||||||
import { WorkspaceType } from '../src/core/workspaces';
|
|
||||||
import {
|
import {
|
||||||
acceptInviteById,
|
acceptInviteById,
|
||||||
approveMember,
|
approveMember,
|
||||||
@@ -2,7 +2,7 @@ import type { INestApplication } from '@nestjs/common';
|
|||||||
import test from 'ava';
|
import test from 'ava';
|
||||||
import request from 'supertest';
|
import request from 'supertest';
|
||||||
|
|
||||||
import { AppModule } from '../src/app.module';
|
import { AppModule } from '../app.module';
|
||||||
import { createTestingApp, currentUser, signUp } from './utils';
|
import { createTestingApp, currentUser, signUp } from './utils';
|
||||||
|
|
||||||
let app: INestApplication;
|
let app: INestApplication;
|
||||||
@@ -3,8 +3,8 @@ import type { TestFn } from 'ava';
|
|||||||
import ava from 'ava';
|
import ava from 'ava';
|
||||||
import request from 'supertest';
|
import request from 'supertest';
|
||||||
|
|
||||||
import { AppModule } from '../../src/app.module';
|
import { AppModule } from '../../app.module';
|
||||||
import { AuthService, CurrentUser } from '../../src/core/auth';
|
import { AuthService, CurrentUser } from '../../core/auth';
|
||||||
import { createTestingApp, gql, internalSignIn } from '../utils';
|
import { createTestingApp, gql, internalSignIn } from '../utils';
|
||||||
|
|
||||||
const test = ava as TestFn<{
|
const test = ava as TestFn<{
|
||||||
@@ -6,7 +6,7 @@ import request from 'supertest';
|
|||||||
import {
|
import {
|
||||||
DEFAULT_DIMENSIONS,
|
DEFAULT_DIMENSIONS,
|
||||||
OpenAIProvider,
|
OpenAIProvider,
|
||||||
} from '../../src/plugins/copilot/providers/openai';
|
} from '../../plugins/copilot/providers/openai';
|
||||||
import {
|
import {
|
||||||
CopilotCapability,
|
CopilotCapability,
|
||||||
CopilotChatOptions,
|
CopilotChatOptions,
|
||||||
@@ -19,13 +19,13 @@ import {
|
|||||||
CopilotTextToTextProvider,
|
CopilotTextToTextProvider,
|
||||||
PromptConfig,
|
PromptConfig,
|
||||||
PromptMessage,
|
PromptMessage,
|
||||||
} from '../../src/plugins/copilot/types';
|
} from '../../plugins/copilot/types';
|
||||||
import { NodeExecutorType } from '../../src/plugins/copilot/workflow/executor';
|
import { NodeExecutorType } from '../../plugins/copilot/workflow/executor';
|
||||||
import {
|
import {
|
||||||
WorkflowGraph,
|
WorkflowGraph,
|
||||||
WorkflowNodeType,
|
WorkflowNodeType,
|
||||||
WorkflowParams,
|
WorkflowParams,
|
||||||
} from '../../src/plugins/copilot/workflow/types';
|
} from '../../plugins/copilot/workflow/types';
|
||||||
import { gql } from './common';
|
import { gql } from './common';
|
||||||
import { handleGraphQLError, sleep } from './utils';
|
import { handleGraphQLError, sleep } from './utils';
|
||||||
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { PrismaClient, WorkspaceMemberStatus } from '@prisma/client';
|
import { PrismaClient, WorkspaceMemberStatus } from '@prisma/client';
|
||||||
|
|
||||||
import { Permission } from '../../src/core/permission';
|
import { Permission } from '../../core/permission';
|
||||||
import { UserType } from '../../src/core/user/types';
|
import { UserType } from '../../core/user/types';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class WorkspaceResolverMock {
|
export class WorkspaceResolverMock {
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import type { INestApplication } from '@nestjs/common';
|
import type { INestApplication } from '@nestjs/common';
|
||||||
import request from 'supertest';
|
import request from 'supertest';
|
||||||
|
|
||||||
import type { InvitationType } from '../../src/core/workspaces';
|
import type { InvitationType } from '../../core/workspaces';
|
||||||
import { gql } from './common';
|
import { gql } from './common';
|
||||||
|
|
||||||
export async function inviteUser(
|
export async function inviteUser(
|
||||||
@@ -5,9 +5,9 @@ import {
|
|||||||
AuthService,
|
AuthService,
|
||||||
type ClientTokenType,
|
type ClientTokenType,
|
||||||
type CurrentUser,
|
type CurrentUser,
|
||||||
} from '../../src/core/auth';
|
} from '../../core/auth';
|
||||||
import { sessionUser } from '../../src/core/auth/service';
|
import { sessionUser } from '../../core/auth/service';
|
||||||
import { UserService, type UserType } from '../../src/core/user';
|
import { UserService, type UserType } from '../../core/user';
|
||||||
import { gql } from './common';
|
import { gql } from './common';
|
||||||
|
|
||||||
export type UserAuthedType = UserType & { token: ClientTokenType };
|
export type UserAuthedType = UserType & { token: ClientTokenType };
|
||||||
@@ -8,12 +8,12 @@ import graphqlUploadExpress from 'graphql-upload/graphqlUploadExpress.mjs';
|
|||||||
import type { Response } from 'supertest';
|
import type { Response } from 'supertest';
|
||||||
import supertest from 'supertest';
|
import supertest from 'supertest';
|
||||||
|
|
||||||
import { AppModule, FunctionalityModules } from '../../src/app.module';
|
import { AppModule, FunctionalityModules } from '../../app.module';
|
||||||
import { GlobalExceptionFilter, Runtime } from '../../src/base';
|
import { GlobalExceptionFilter, Runtime } from '../../base';
|
||||||
import { GqlModule } from '../../src/base/graphql';
|
import { GqlModule } from '../../base/graphql';
|
||||||
import { AuthGuard, AuthModule } from '../../src/core/auth';
|
import { AuthGuard, AuthModule } from '../../core/auth';
|
||||||
import { UserFeaturesInit1698652531198 } from '../../src/data/migrations/1698652531198-user-features-init';
|
import { UserFeaturesInit1698652531198 } from '../../data/migrations/1698652531198-user-features-init';
|
||||||
import { ModelModules } from '../../src/models';
|
import { ModelModules } from '../../models';
|
||||||
|
|
||||||
export type PermissionEnum = 'Owner' | 'Admin' | 'Write' | 'Read';
|
export type PermissionEnum = 'Owner' | 'Admin' | 'Write' | 'Read';
|
||||||
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import type { INestApplication } from '@nestjs/common';
|
import type { INestApplication } from '@nestjs/common';
|
||||||
import request from 'supertest';
|
import request from 'supertest';
|
||||||
|
|
||||||
import type { WorkspaceType } from '../../src/core/workspaces';
|
import type { WorkspaceType } from '../../core/workspaces';
|
||||||
import { gql } from './common';
|
import { gql } from './common';
|
||||||
import { PermissionEnum } from './utils';
|
import { PermissionEnum } from './utils';
|
||||||
|
|
||||||
@@ -7,10 +7,10 @@ import { PrismaClient } from '@prisma/client';
|
|||||||
import type { TestFn } from 'ava';
|
import type { TestFn } from 'ava';
|
||||||
import ava from 'ava';
|
import ava from 'ava';
|
||||||
|
|
||||||
import { AppModule } from '../src/app.module';
|
import { AppModule } from '../app.module';
|
||||||
import { MailService } from '../src/base/mailer';
|
import { MailService } from '../base/mailer';
|
||||||
import { AuthService } from '../src/core/auth/service';
|
import { AuthService } from '../core/auth/service';
|
||||||
import { UserService } from '../src/core/user';
|
import { UserService } from '../core/user';
|
||||||
import {
|
import {
|
||||||
acceptInviteById,
|
acceptInviteById,
|
||||||
createTestingApp,
|
createTestingApp,
|
||||||
@@ -4,7 +4,7 @@ import type { TestFn } from 'ava';
|
|||||||
import ava from 'ava';
|
import ava from 'ava';
|
||||||
import request from 'supertest';
|
import request from 'supertest';
|
||||||
|
|
||||||
import { AppModule } from '../src/app.module';
|
import { AppModule } from '../app.module';
|
||||||
import {
|
import {
|
||||||
acceptInviteById,
|
acceptInviteById,
|
||||||
createTestingApp,
|
createTestingApp,
|
||||||
@@ -2,9 +2,9 @@ import type { INestApplication } from '@nestjs/common';
|
|||||||
import test from 'ava';
|
import test from 'ava';
|
||||||
import request from 'supertest';
|
import request from 'supertest';
|
||||||
|
|
||||||
import { AppModule } from '../../src/app.module';
|
import { AppModule } from '../../app.module';
|
||||||
import { FeatureManagementService, FeatureType } from '../../src/core/features';
|
import { FeatureManagementService, FeatureType } from '../../core/features';
|
||||||
import { QuotaService, QuotaType } from '../../src/core/quota';
|
import { QuotaService, QuotaType } from '../../core/quota';
|
||||||
import {
|
import {
|
||||||
collectAllBlobSizes,
|
collectAllBlobSizes,
|
||||||
createTestingApp,
|
createTestingApp,
|
||||||
@@ -6,11 +6,11 @@ import ava, { TestFn } from 'ava';
|
|||||||
import Sinon from 'sinon';
|
import Sinon from 'sinon';
|
||||||
import request from 'supertest';
|
import request from 'supertest';
|
||||||
|
|
||||||
import { AppModule } from '../../src/app.module';
|
import { AppModule } from '../../app.module';
|
||||||
import { CurrentUser } from '../../src/core/auth';
|
import { CurrentUser } from '../../core/auth';
|
||||||
import { AuthService } from '../../src/core/auth/service';
|
import { AuthService } from '../../core/auth/service';
|
||||||
import { PgWorkspaceDocStorageAdapter } from '../../src/core/doc';
|
import { PgWorkspaceDocStorageAdapter } from '../../core/doc';
|
||||||
import { WorkspaceBlobStorage } from '../../src/core/storage';
|
import { WorkspaceBlobStorage } from '../../core/storage';
|
||||||
import { createTestingApp, internalSignIn } from '../utils';
|
import { createTestingApp, internalSignIn } from '../utils';
|
||||||
|
|
||||||
const test = ava as TestFn<{
|
const test = ava as TestFn<{
|
||||||
@@ -13,6 +13,7 @@
|
|||||||
"references": [
|
"references": [
|
||||||
{ "path": "../../../tests/kit" },
|
{ "path": "../../../tests/kit" },
|
||||||
{ "path": "../../../tools/cli" },
|
{ "path": "../../../tools/cli" },
|
||||||
|
{ "path": "../../../tools/utils" },
|
||||||
{ "path": "../native" }
|
{ "path": "../native" }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "./tsconfig.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"allowJs": true,
|
|
||||||
"rootDir": ".",
|
|
||||||
"outDir": "./lib",
|
|
||||||
"tsBuildInfoFile": "./lib/tsconfig.tsbuildinfo"
|
|
||||||
},
|
|
||||||
"include": ["./scripts", "./tests"]
|
|
||||||
}
|
|
||||||
@@ -451,6 +451,7 @@ export const PackageList = [
|
|||||||
workspaceDependencies: [
|
workspaceDependencies: [
|
||||||
'tests/kit',
|
'tests/kit',
|
||||||
'tools/cli',
|
'tools/cli',
|
||||||
|
'tools/utils',
|
||||||
'packages/backend/native',
|
'packages/backend/native',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -751,6 +751,7 @@ __metadata:
|
|||||||
dependencies:
|
dependencies:
|
||||||
"@affine-test/kit": "workspace:*"
|
"@affine-test/kit": "workspace:*"
|
||||||
"@affine-tools/cli": "workspace:*"
|
"@affine-tools/cli": "workspace:*"
|
||||||
|
"@affine-tools/utils": "workspace:*"
|
||||||
"@affine/server-native": "workspace:*"
|
"@affine/server-native": "workspace:*"
|
||||||
"@apollo/server": "npm:^4.11.2"
|
"@apollo/server": "npm:^4.11.2"
|
||||||
"@aws-sdk/client-s3": "npm:^3.709.0"
|
"@aws-sdk/client-s3": "npm:^3.709.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user