Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/layout-engine/contracts/bunfig.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[test]
timeout = 5000
preload = ["./happydom.ts"]
13 changes: 13 additions & 0 deletions packages/layout-engine/contracts/happydom.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Window } from 'happy-dom';

const window = new Window();

// Register globals
Object.assign(globalThis, {
window,
document: window.document,
HTMLElement: window.HTMLElement,
Element: window.Element,
Node: window.Node,
Blob: window.Blob,
});
5 changes: 4 additions & 1 deletion packages/layout-engine/contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
},
"scripts": {
"build": "tsc --project tsconfig.json",
"test": "vitest run"
"test": "bun test"
},
"devDependencies": {
"happy-dom": "catalog:"
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, it } from 'vitest';
import { describe, expect, it } from 'bun:test';
import { computeWrapExclusion, scaleWrapPolygon } from '../image-wrap.js';

describe('engines-image-wrap scaleWrapPolygon', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, it } from 'vitest';
import { describe, expect, it } from 'bun:test';
import { computeListIndent, formatListLabel } from '../lists.js';

describe('engines-lists formatListLabel', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, it } from 'vitest';
import { describe, expect, it } from 'bun:test';
import { resolveSpacingIndent } from '../paragraph.js';

describe('engines-paragraph resolveSpacingIndent', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/layout-engine/contracts/src/engines/tabs.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, it } from 'vitest';
import { describe, expect, it } from 'bun:test';
import { calculateTabWidth, computeTabStops, layoutWithTabs } from './tabs.js';

describe('engines-tabs computeTabStops', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/layout-engine/contracts/src/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, it } from 'vitest';
import { describe, expect, it } from 'bun:test';
import { extractHeaderFooterSpace } from './index.js';
import type { FlowBlock, Layout, PainterDOM, PainterPDF } from './index.js';

Expand Down
2 changes: 1 addition & 1 deletion packages/layout-engine/contracts/src/justify-utils.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, it } from 'vitest';
import { describe, expect, it } from 'bun:test';
import {
SPACE_CHARS,
shouldApplyJustify,
Expand Down
2 changes: 1 addition & 1 deletion packages/layout-engine/contracts/src/pm-range.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, it } from 'vitest';
import { describe, expect, it } from 'bun:test';
import { computeFragmentPmRange, computeLinePmRange } from './index.js';
import type { Line, ParagraphBlock } from './index.js';

Expand Down
11 changes: 0 additions & 11 deletions packages/layout-engine/contracts/vitest.config.mjs

This file was deleted.

2 changes: 2 additions & 0 deletions packages/layout-engine/geometry-utils/bunfig.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[test]
timeout = 5000
5 changes: 2 additions & 3 deletions packages/layout-engine/geometry-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@
},
"scripts": {
"build": "tsc --project tsconfig.json --noEmit",
"test": "vitest run"
"test": "bun test"
},
"devDependencies": {
"typescript": "catalog:",
"vitest": "catalog:"
"typescript": "catalog:"
}
}
2 changes: 1 addition & 1 deletion packages/layout-engine/geometry-utils/src/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, it } from 'vitest';
import { describe, expect, it } from 'bun:test';
import {
applyMatrix,
calculateRotatedBounds,
Expand Down
10 changes: 0 additions & 10 deletions packages/layout-engine/geometry-utils/vitest.config.mjs

This file was deleted.

2 changes: 2 additions & 0 deletions packages/layout-engine/style-engine/bunfig.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[test]
timeout = 5000
5 changes: 2 additions & 3 deletions packages/layout-engine/style-engine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@
},
"scripts": {
"build": "tsc --project tsconfig.json --noEmit",
"test": "vitest run"
"test": "bun test"
},
"dependencies": {
"@superdoc/contracts": "workspace:*",
"@superdoc/font-utils": "workspace:*"
},
"devDependencies": {
"typescript": "catalog:",
"vitest": "catalog:"
"typescript": "catalog:"
}
Comment on lines 26 to 28

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep vitest as a dev dependency for benchmarks

Removing vitest from @superdoc/style-engine breaks pnpm build/tsc --project tsconfig.json --noEmit because src/bench/resolveSdtMetadata.bench.ts still imports bench from vitest and tsconfig.json includes all src/**/*. In this package, that means TypeScript can no longer resolve the module during builds (even if tests run under Bun), so the migration leaves the package unable to typecheck unless vitest is restored or the bench file is excluded.

Useful? React with 👍 / 👎.

}
2 changes: 1 addition & 1 deletion packages/layout-engine/style-engine/src/cascade.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, it } from 'vitest';
import { describe, expect, it } from 'bun:test';
import { combineProperties, combineRunProperties, combineIndentProperties } from './cascade.js';

describe('cascade - combineProperties', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/layout-engine/style-engine/src/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, it, beforeEach } from 'vitest';
import { describe, expect, it, beforeEach } from 'bun:test';
import { resolveSdtMetadata, clearSdtMetadataCache } from './index.js';

describe('resolveSdtMetadata', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, it } from 'vitest';
import { describe, expect, it } from 'bun:test';
import {
resolveStyleChain,
getNumberingProperties,
Expand Down
9 changes: 0 additions & 9 deletions packages/layout-engine/style-engine/vitest.config.mjs

This file was deleted.

2 changes: 2 additions & 0 deletions packages/word-layout/bunfig.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[test]
timeout = 5000
5 changes: 1 addition & 4 deletions packages/word-layout/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
},
"scripts": {
"build": "tsc --project tsconfig.json",
"test": "vitest run"
},
"devDependencies": {
"vitest": "catalog:"
"test": "bun test"
}
}
2 changes: 1 addition & 1 deletion packages/word-layout/tests/numbering-manager.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, it } from 'vitest';
import { describe, expect, it } from 'bun:test';

import { createNumberingManager } from '../src/numbering-manager.js';

Expand Down
2 changes: 1 addition & 1 deletion packages/word-layout/tests/unit-conversions.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, it } from 'vitest';
import { describe, expect, it } from 'bun:test';

import {
TWIPS_PER_PIXEL,
Expand Down
2 changes: 1 addition & 1 deletion packages/word-layout/tests/word-layout.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, it } from 'vitest';
import { describe, expect, it } from 'bun:test';

import { computeWordParagraphLayout, DEFAULT_LIST_HANGING_PX } from '../src/index.js';
import type { WordParagraphLayoutInput } from '../src/types.js';
Expand Down
9 changes: 0 additions & 9 deletions packages/word-layout/vitest.config.mjs

This file was deleted.

18 changes: 6 additions & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading