// api/vitest.config.ts
export default defineWorkersProject(async () => {
return {
test: {
// … more setup
poolOptions: {
workers: {
wrangler: { configPath: `${__dirname}/wrangler.jsonc`, environment: 'test' },
singleWorker: true,
miniflare: {
bindings: {
TEST_MIGRATIONS: migrations,
TEST_SEED_FILES: seedFiles,
},
serviceBindings: {
USERS_SERVICE: { name: 'my-services', entrypoint: 'UsersService' },
FOO_SERVICE: { name: 'my-services', entryPoint: 'FooService' },
},
workers: [
{ // built by globalSetup.ts, coped into this directory
name: my-services',
modules: true,
scriptPath: './.test/workers/services/my_services/index.js',
compatibilityDate: '2025-01-01',
compatibilityFlags: ['nodejs_compat'],
},
],
},
},
},
},
};
});
// api/vitest.config.ts
export default defineWorkersProject(async () => {
return {
test: {
// … more setup
poolOptions: {
workers: {
wrangler: { configPath: `${__dirname}/wrangler.jsonc`, environment: 'test' },
singleWorker: true,
miniflare: {
bindings: {
TEST_MIGRATIONS: migrations,
TEST_SEED_FILES: seedFiles,
},
serviceBindings: {
USERS_SERVICE: { name: 'my-services', entrypoint: 'UsersService' },
FOO_SERVICE: { name: 'my-services', entryPoint: 'FooService' },
},
workers: [
{ // built by globalSetup.ts, coped into this directory
name: my-services',
modules: true,
scriptPath: './.test/workers/services/my_services/index.js',
compatibilityDate: '2025-01-01',
compatibilityFlags: ['nodejs_compat'],
},
],
},
},
},
},
};
});