diff --git a/resources/scripts/tsconfig.json b/resources/scripts/tsconfig.json
new file mode 100644
index 0000000000..938d4788bb
--- /dev/null
+++ b/resources/scripts/tsconfig.json
@@ -0,0 +1,7 @@
+{
+ "extends": "../../tsconfig.json",
+ "compilerOptions": {
+ "types": ["node"]
+ },
+ "include": ["*.ts"]
+}
diff --git a/tests/Unit/CommitImages.test.tsx b/tests/Unit/CommitImages.test.tsx
index 95a82763fd..c6d6329429 100644
--- a/tests/Unit/CommitImages.test.tsx
+++ b/tests/Unit/CommitImages.test.tsx
@@ -1,7 +1,7 @@
///
import assert from 'node:assert/strict';
-import { test } from 'node:test';
import { renderToStaticMarkup } from 'react-dom/server';
+import { test } from 'vite-plus/test';
import {
CommitImages,
replaceFailedImage,
@@ -37,6 +37,7 @@ const commit: Commit = {
has_sponsors_listing: false,
has_github_account: true,
lane: 0,
+ timezone: null,
created_at: '2026-10-16T10:00:00Z',
updated_at: '2026-10-16T10:00:00Z',
},
@@ -51,7 +52,7 @@ const commit: Commit = {
],
};
-void test('keeps the uploaded image until it fails to load', () => {
+test('keeps the uploaded image until it fails to load', () => {
assert.ok(
renderToStaticMarkup().includes(
'src="/images/missing.webp"',
@@ -59,7 +60,7 @@ void test('keeps the uploaded image until it fails to load', () => {
);
});
-void test('shows the short image hash instead of the alt text while the image loads', () => {
+test('shows the short image hash instead of the alt text while the image loads', () => {
const markup = renderToStaticMarkup();
const placeholder = markup.match(
/
<\/div><\/div>/,
@@ -69,7 +70,7 @@ void test('shows the short image hash instead of the alt text while the image lo
assert.equal(placeholder[0].replace(/<[^>]+>/g, ''), 'commitb8a0c3d');
});
-void test('scrambles each hash differently, locking it in from left to right, then rolls again', () => {
+test('scrambles each hash differently, locking it in from left to right, then rolls again', () => {
const lockedAt = (frame: number) =>
scrambleHash('9f3a6c1', frame)
.filter(({ isLocked }) => isLocked)
@@ -100,7 +101,7 @@ void test('scrambles each hash differently, locking it in from left to right, th
);
});
-void test('replaces a failed image with the site logo without retrying the fallback', () => {
+test('replaces a failed image with the site logo without retrying the fallback', () => {
let replacements = 0;
let source = '/images/missing.webp';
const target = {
@@ -121,6 +122,6 @@ void test('replaces a failed image with the site logo without retrying the fallb
assert.equal(replacements, 1);
});
-void test('renders nothing when there are no uploaded images', () => {
+test('renders nothing when there are no uploaded images', () => {
assert.equal(CommitImages({ commit: { ...commit, images: [] } }), null);
});
diff --git a/tests/Unit/CommitQuoteButton.test.tsx b/tests/Unit/CommitQuoteButton.test.tsx
index c57f4aa962..5cb659debf 100644
--- a/tests/Unit/CommitQuoteButton.test.tsx
+++ b/tests/Unit/CommitQuoteButton.test.tsx
@@ -1,9 +1,9 @@
///
import assert from 'node:assert/strict';
-import { test } from 'node:test';
import { createInertiaApp } from '@inertiajs/react';
import { renderToString } from 'react-dom/server';
+import { test } from 'vite-plus/test';
import { CommitQuoteButton } from '../../resources/js/components/commit-quote-button';
import { TooltipProvider } from '../../resources/js/components/ui/tooltip';
import type { Commit } from '../../resources/js/types';
@@ -15,7 +15,7 @@ const commit = {
} as Commit;
for (const user of [null, { id: 'viewer' }]) {
- void test(`renders the quote control for ${user === null ? 'guests' : 'signed-in readers'}`, async () => {
+ test(`renders the quote control for ${user === null ? 'guests' : 'signed-in readers'}`, async () => {
const result = await createInertiaApp<{
auth: { user: { id: string } | null };
}>({
diff --git a/tests/Unit/CommitStarButton.test.tsx b/tests/Unit/CommitStarButton.test.tsx
index 90ea87d09f..e13fd77e56 100644
--- a/tests/Unit/CommitStarButton.test.tsx
+++ b/tests/Unit/CommitStarButton.test.tsx
@@ -1,9 +1,9 @@
///
import assert from 'node:assert/strict';
-import { test } from 'node:test';
import { createInertiaApp } from '@inertiajs/react';
import { renderToString } from 'react-dom/server';
+import { test } from 'vite-plus/test';
import { CommitStarButton } from '../../resources/js/components/commit-star-button';
import { TooltipProvider } from '../../resources/js/components/ui/tooltip';
import type { Commit } from '../../resources/js/types';
@@ -54,7 +54,7 @@ async function render(
}
for (const status of ['approved', 'pending', 'rejected'] as const) {
- void test(`authors see only their ${status} commit's star count`, async () => {
+ test(`authors see only their ${status} commit's star count`, async () => {
const body = await render({ id: 'author' }, { status });
assert.match(body, /data-test="star-count-readonly"/);
@@ -63,7 +63,7 @@ for (const status of ['approved', 'pending', 'rejected'] as const) {
});
}
-void test('authors see an accessible empty star count', async () => {
+test('authors see an accessible empty star count', async () => {
const body = await render({ id: 'author' }, { stars_count: 0 });
assert.match(body, /aria-label="No stars yet"/);
@@ -71,7 +71,7 @@ void test('authors see an accessible empty star count', async () => {
});
for (const user of [null, { id: 'viewer' }]) {
- void test(`approved commits keep the star control for ${user === null ? 'guests' : 'other readers'}`, async () => {
+ test(`approved commits keep the star control for ${user === null ? 'guests' : 'other readers'}`, async () => {
const body = await render(user);
assert.match(body, /data-test="star-commit-button"/);
@@ -82,7 +82,7 @@ for (const user of [null, { id: 'viewer' }]) {
}
for (const status of ['pending', 'rejected'] as const) {
- void test(`other readers cannot star a ${status} commit`, async () => {
+ test(`other readers cannot star a ${status} commit`, async () => {
const body = await render({ id: 'viewer' }, { status });
assert.doesNotMatch(
@@ -93,7 +93,7 @@ for (const status of ['pending', 'rejected'] as const) {
}
for (const status of ['approved', 'pending', 'rejected'] as const) {
- void test(`authors see their ${status} reply's read-only star count`, async () => {
+ test(`authors see their ${status} reply's read-only star count`, async () => {
const body = await render(
{ id: 'author' },
{ status, parent_id: 'parent' },
diff --git a/tests/Unit/CommitThread.test.tsx b/tests/Unit/CommitThread.test.tsx
index 4467068f63..d3965aa80b 100644
--- a/tests/Unit/CommitThread.test.tsx
+++ b/tests/Unit/CommitThread.test.tsx
@@ -1,9 +1,9 @@
///
import assert from 'node:assert/strict';
-import { test } from 'node:test';
import { createInertiaApp } from '@inertiajs/react';
import { renderToString } from 'react-dom/server';
+import { test } from 'vite-plus/test';
import {
ThreadActions,
ThreadReplies,
@@ -21,8 +21,15 @@ const reply = (id: string): Commit =>
created_at: new Date().toISOString(),
status: 'approved',
body_segments: [{ type: 'text', text: `Visible reply ${id}` }],
+ preview_segments: null,
replies_count: 0,
- user: { id: 'author', name: 'Author', username: 'author', lane: 1, timezone: null },
+ user: {
+ id: 'author',
+ name: 'Author',
+ username: 'author',
+ lane: 1,
+ timezone: null,
+ },
}) as Commit;
async function renderThread(count: number) {
@@ -70,7 +77,7 @@ async function renderThread(count: number) {
}
for (const count of [0, 1, 2, 5]) {
- void test(`shows ${Math.min(count, 1)} replies immediately out of ${count}`, async () => {
+ test(`shows ${Math.min(count, 1)} replies immediately out of ${count}`, async () => {
const html = await renderThread(count);
assert.equal(
(html.match(/Visible reply /g) ?? []).length,
diff --git a/tests/Unit/ComposerPreview.test.tsx b/tests/Unit/ComposerPreview.test.tsx
index b1add594f0..f455af52e0 100644
--- a/tests/Unit/ComposerPreview.test.tsx
+++ b/tests/Unit/ComposerPreview.test.tsx
@@ -1,9 +1,9 @@
///
import assert from 'node:assert/strict';
-import { test } from 'node:test';
import { App } from '@inertiajs/react';
import type { ComponentProps, KeyboardEvent, ReactElement } from 'react';
import { renderToStaticMarkup } from 'react-dom/server';
+import { test } from 'vite-plus/test';
import { CommitBody } from '../../resources/js/components/commit-body';
import { CommitComposer } from '../../resources/js/components/commit-composer';
import { revokeObjectUrls } from '../../resources/js/components/commit-image-picker';
@@ -75,7 +75,7 @@ function previewFor(options: {
for (const modifier of ['ctrlKey', 'metaKey'] as const) {
for (const shiftKey of [false, true]) {
- void test(`${modifier} + ${shiftKey ? 'Shift + ' : ''}Enter publishes from preview`, () => {
+ test(`${modifier} + ${shiftKey ? 'Shift + ' : ''}Enter publishes from preview`, () => {
let submitted = 0;
let prevented = 0;
const preview = previewFor({ isSubmittable: true });
@@ -96,7 +96,7 @@ for (const modifier of ['ctrlKey', 'metaKey'] as const) {
}
}
-void test('does not publish an incomplete draft from preview', () => {
+test('does not publish an incomplete draft from preview', () => {
previewFor({ isSubmittable: false }).onPreviewKeyDown({
key: 'Enter',
ctrlKey: true,
@@ -165,7 +165,7 @@ function renderComposer(body: string): string {
}
for (const count of [1, 2, 3, 3850]) {
- void test(`counts ${count} emoji as Unicode characters in the preview composer`, () => {
+ test(`counts ${count} emoji as Unicode characters in the preview composer`, () => {
const markup = renderComposer('🚀'.repeat(count));
const submit = markup.match(
/