fix: format E2E tests and add helpers to knip ignore
This commit is contained in:
parent
a9f6e1de6f
commit
56161ed2e1
4 changed files with 81 additions and 23 deletions
|
|
@ -5,7 +5,7 @@
|
||||||
"tailwind": {
|
"tailwind": {
|
||||||
"entry": ["src/main.css"]
|
"entry": ["src/main.css"]
|
||||||
},
|
},
|
||||||
"ignore": ["src/i18n/**"],
|
"ignore": ["src/i18n/**", "tests/e2e/helpers.ts"],
|
||||||
"ignoreDependencies": [],
|
"ignoreDependencies": [],
|
||||||
"ignoreExportsUsedInFile": true
|
"ignoreExportsUsedInFile": true
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -203,18 +203,16 @@ describe("i18n Module", () => {
|
||||||
|
|
||||||
describe("Transfer Module", () => {
|
describe("Transfer Module", () => {
|
||||||
test("Transfer 常數應該正確定義", async () => {
|
test("Transfer 常數應該正確定義", async () => {
|
||||||
const { CHUNK_THRESHOLD_BYTES, CHUNK_SIZE_BYTES } = await import(
|
const { CHUNK_THRESHOLD_BYTES, CHUNK_SIZE_BYTES } =
|
||||||
"../../src/transfer/constants"
|
await import("../../src/transfer/constants");
|
||||||
);
|
|
||||||
|
|
||||||
expect(CHUNK_THRESHOLD_BYTES).toBe(10 * 1024 * 1024); // 10MB
|
expect(CHUNK_THRESHOLD_BYTES).toBe(10 * 1024 * 1024); // 10MB
|
||||||
expect(CHUNK_SIZE_BYTES).toBe(5 * 1024 * 1024); // 5MB
|
expect(CHUNK_SIZE_BYTES).toBe(5 * 1024 * 1024); // 5MB
|
||||||
});
|
});
|
||||||
|
|
||||||
test("允許的封裝格式應該是 .tar", async () => {
|
test("允許的封裝格式應該是 .tar", async () => {
|
||||||
const { ALLOWED_ARCHIVE_FORMAT, FORBIDDEN_ARCHIVE_FORMATS } = await import(
|
const { ALLOWED_ARCHIVE_FORMAT, FORBIDDEN_ARCHIVE_FORMATS } =
|
||||||
"../../src/transfer/constants"
|
await import("../../src/transfer/constants");
|
||||||
);
|
|
||||||
|
|
||||||
expect(ALLOWED_ARCHIVE_FORMAT).toBe(".tar");
|
expect(ALLOWED_ARCHIVE_FORMAT).toBe(".tar");
|
||||||
expect(FORBIDDEN_ARCHIVE_FORMATS).toContain(".tar.gz");
|
expect(FORBIDDEN_ARCHIVE_FORMATS).toContain(".tar.gz");
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ def hello_world():
|
||||||
## Table Example
|
## Table Example
|
||||||
|
|
||||||
| Format | Type | Converter |
|
| Format | Type | Converter |
|
||||||
|--------|------|-----------|
|
| ------ | -------- | ----------- |
|
||||||
| SVG | Image | Inkscape |
|
| SVG | Image | Inkscape |
|
||||||
| PDF | Document | LibreOffice |
|
| PDF | Document | LibreOffice |
|
||||||
| MP4 | Video | FFmpeg |
|
| MP4 | Video | FFmpeg |
|
||||||
|
|
@ -43,4 +43,4 @@ Thank you for using ConvertX!
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
*This document is used for E2E testing purposes.*
|
_This document is used for E2E testing purposes._
|
||||||
|
|
|
||||||
|
|
@ -125,15 +125,75 @@ export function createTestSvg(outputPath: string): void {
|
||||||
export function createTestPng(outputPath: string): void {
|
export function createTestPng(outputPath: string): void {
|
||||||
// 最小的有效 PNG 檔案 (1x1 紅色像素)
|
// 最小的有效 PNG 檔案 (1x1 紅色像素)
|
||||||
const pngBuffer = Buffer.from([
|
const pngBuffer = Buffer.from([
|
||||||
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, // PNG signature
|
0x89,
|
||||||
0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, // IHDR chunk
|
0x50,
|
||||||
0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, // 1x1 dimensions
|
0x4e,
|
||||||
0x08, 0x02, 0x00, 0x00, 0x00, 0x90, 0x77, 0x53, 0xde, // bit depth, color type, etc
|
0x47,
|
||||||
0x00, 0x00, 0x00, 0x0c, 0x49, 0x44, 0x41, 0x54, // IDAT chunk
|
0x0d,
|
||||||
0x08, 0xd7, 0x63, 0xf8, 0xcf, 0xc0, 0x00, 0x00, // compressed data
|
0x0a,
|
||||||
0x01, 0x01, 0x01, 0x00, 0x18, 0xdd, 0x8d, 0xb4, // checksum
|
0x1a,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, // IEND chunk
|
0x0a, // PNG signature
|
||||||
0xae, 0x42, 0x60, 0x82,
|
0x00,
|
||||||
|
0x00,
|
||||||
|
0x00,
|
||||||
|
0x0d,
|
||||||
|
0x49,
|
||||||
|
0x48,
|
||||||
|
0x44,
|
||||||
|
0x52, // IHDR chunk
|
||||||
|
0x00,
|
||||||
|
0x00,
|
||||||
|
0x00,
|
||||||
|
0x01,
|
||||||
|
0x00,
|
||||||
|
0x00,
|
||||||
|
0x00,
|
||||||
|
0x01, // 1x1 dimensions
|
||||||
|
0x08,
|
||||||
|
0x02,
|
||||||
|
0x00,
|
||||||
|
0x00,
|
||||||
|
0x00,
|
||||||
|
0x90,
|
||||||
|
0x77,
|
||||||
|
0x53,
|
||||||
|
0xde, // bit depth, color type, etc
|
||||||
|
0x00,
|
||||||
|
0x00,
|
||||||
|
0x00,
|
||||||
|
0x0c,
|
||||||
|
0x49,
|
||||||
|
0x44,
|
||||||
|
0x41,
|
||||||
|
0x54, // IDAT chunk
|
||||||
|
0x08,
|
||||||
|
0xd7,
|
||||||
|
0x63,
|
||||||
|
0xf8,
|
||||||
|
0xcf,
|
||||||
|
0xc0,
|
||||||
|
0x00,
|
||||||
|
0x00, // compressed data
|
||||||
|
0x01,
|
||||||
|
0x01,
|
||||||
|
0x01,
|
||||||
|
0x00,
|
||||||
|
0x18,
|
||||||
|
0xdd,
|
||||||
|
0x8d,
|
||||||
|
0xb4, // checksum
|
||||||
|
0x00,
|
||||||
|
0x00,
|
||||||
|
0x00,
|
||||||
|
0x00,
|
||||||
|
0x49,
|
||||||
|
0x45,
|
||||||
|
0x4e,
|
||||||
|
0x44, // IEND chunk
|
||||||
|
0xae,
|
||||||
|
0x42,
|
||||||
|
0x60,
|
||||||
|
0x82,
|
||||||
]);
|
]);
|
||||||
writeFileSync(outputPath, pngBuffer);
|
writeFileSync(outputPath, pngBuffer);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue