chore: standardize tsconfig (#9568)

This commit is contained in:
forehalo
2025-01-08 04:07:56 +00:00
parent 39f4b17315
commit c0ed74dfed
151 changed files with 1041 additions and 1566 deletions
@@ -1,6 +1,4 @@
import path from 'node:path';
import { test } from '@affine-test/kit/playwright';
import { Path, test } from '@affine-test/kit/playwright';
import { openHomePage } from '@affine-test/kit/utils/load-page';
import {
clickNewPageButton,
@@ -16,6 +14,8 @@ import {
import type { Page } from '@playwright/test';
import { expect } from '@playwright/test';
const fixturesDir = Path.dir(import.meta.url).join('../../fixtures');
async function clickPeekViewControl(page: Page, n = 0) {
await page.getByTestId('peek-view-control').nth(n).click();
await page.waitForTimeout(500);
@@ -66,10 +66,7 @@ test('attachment preview should be shown', async ({ page }) => {
await title.click();
await page.keyboard.press('Enter');
await insertAttachment(
page,
path.join(__dirname, '../../fixtures/lorem-ipsum.pdf')
);
await insertAttachment(page, fixturesDir.join('lorem-ipsum.pdf').value);
await page.locator('affine-attachment').first().dblclick();
@@ -107,10 +104,7 @@ test('attachment preview can be expanded', async ({ page }) => {
await title.click();
await page.keyboard.press('Enter');
await insertAttachment(
page,
path.join(__dirname, '../../fixtures/lorem-ipsum.pdf')
);
await insertAttachment(page, fixturesDir.join('lorem-ipsum.pdf').value);
await page.locator('affine-attachment').first().dblclick();
@@ -161,10 +155,7 @@ test('should preview PDF in embed view', async ({ page }) => {
await page.keyboard.press('Enter');
await insertAttachment(
page,
path.join(__dirname, '../../fixtures/lorem-ipsum.pdf')
);
await insertAttachment(page, fixturesDir.join('lorem-ipsum.pdf').value);
const attachment = page.locator('affine-attachment');
await attachment.hover();
@@ -271,10 +262,7 @@ test('should sync name in pdf embed view', async ({ page }) => {
await title.click();
await page.keyboard.press('Enter');
await insertAttachment(
page,
path.join(__dirname, '../../fixtures/lorem-ipsum.pdf')
);
await insertAttachment(page, fixturesDir.join('lorem-ipsum.pdf').value);
const attachment = page.locator('affine-attachment');
await attachment.hover();
@@ -1,6 +1,4 @@
import { resolve } from 'node:path';
import { rootDir, test } from '@affine-test/kit/playwright';
import { ProjectRoot, test } from '@affine-test/kit/playwright';
import { openHomePage } from '@affine-test/kit/utils/load-page';
import {
clickNewPageButton,
@@ -29,7 +27,7 @@ test('should create a page with a local first avatar and remove it', async ({
await page.getByTestId('current-workspace-label').click();
await page
.getByTestId('upload-avatar')
.setInputFiles(resolve(rootDir, 'tests', 'fixtures', 'blue.png'));
.setInputFiles(ProjectRoot.join('tests', 'fixtures', 'blue.png').value);
await page.mouse.click(0, 0);
await page.getByTestId('workspace-name').click();
await page
+1
View File
@@ -1,6 +1,7 @@
{
"name": "@affine-test/affine-local",
"private": true,
"type": "module",
"scripts": {
"e2e": "yarn playwright test"
},
+6 -9
View File
@@ -1,13 +1,10 @@
{
"extends": "../../tsconfig.json",
"extends": "../../tsconfig.web.json",
"compilerOptions": {
"esModuleInterop": true,
"outDir": "lib"
"rootDir": "./e2e",
"outDir": "./dist",
"tsBuildInfoFile": "./dist/tsconfig.tsbuildinfo"
},
"include": ["e2e"],
"references": [
{
"path": "../../tests/kit"
}
]
"include": ["./e2e"],
"references": [{ "path": "../kit" }]
}