Skip to content

Switch to vitest with Cloudflare Workers integration#148

Merged
MattIPv4 merged 15 commits intomasterfrom
MattIPv4/replace-mocha-vitest
Feb 8, 2026
Merged

Switch to vitest with Cloudflare Workers integration#148
MattIPv4 merged 15 commits intomasterfrom
MattIPv4/replace-mocha-vitest

Conversation

@MattIPv4
Copy link
Copy Markdown
Member

@MattIPv4 MattIPv4 commented Feb 8, 2026

Type of Change

  • Tests: Runner

What issue does this relate to?

Resolves #139

What should this PR do?

Switches the test runner from Mocha w/ Miniflare manually controlled to Vitest w/ Cloudflare's Workers integration (uses Miniflare under the hood still).

What are the acceptance criteria?

Test suite continues to pass, no major modifications to test logic.

@MattIPv4 MattIPv4 force-pushed the MattIPv4/replace-mocha-vitest branch from 8f321d9 to 8ff47d8 Compare February 8, 2026 04:00
let response;\n\s*before\('.+', \(\) => request\((.+)\)\.then\(res => { response = res; }\)\);
const response = beforeRequest($1);

import request from '../utils/spec/request.js';
import { beforeRequest, request } from '../utils/spec/request.js';

testCors(path, () => response);
testCors(path, response);

testHuman(() => response);
testHuman(response);
(import .+ from '(chai|chai-http|mocha)';\n)+
import { describe, it, expect } from 'vitest';\n

use\(chaiHttp\);\n+
expect\(response\).to.have.header\('(.+)', '(.+)'\);
expect(response.headers.get('$1')).to.eq('$2');
expect\((.+)\).to.have.status\((.+)\);
expect($1.status).to.eq($2);
expect\((.+)\).to.be.json;
expect($1.headers.get('Content-Type')).to.match(/application\/json/);
expect\((.+)\).to.be.text;
expect($1.headers.get('Content-Type')).to.match(/text\/plain/);
@MattIPv4 MattIPv4 force-pushed the MattIPv4/replace-mocha-vitest branch from a466f2e to 4e6fadf Compare February 8, 2026 04:03
@MattIPv4 MattIPv4 marked this pull request as ready for review February 8, 2026 23:01
@MattIPv4 MattIPv4 merged commit 668682b into master Feb 8, 2026
2 checks passed
@MattIPv4 MattIPv4 deleted the MattIPv4/replace-mocha-vitest branch February 8, 2026 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace mocha with vitest

1 participant