chore: perauset customer project

This commit is contained in:
e2e
2026-07-11 08:54:43 +02:00
commit 49d05dfa0b
293 changed files with 28421 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
{
"name": "tests",
"version": "0.0.1",
"private": true,
"type": "module",
"description": "Function test harness — Cucumber over in-process Pikku RPC with stubbed services.",
"scripts": {
"test": "node --env-file=.env.test node_modules/.bin/cucumber-js --config tests/cucumber.mjs --tags 'not @skip'",
"test:tag": "node --env-file=.env.test node_modules/.bin/cucumber-js --config tests/cucumber.mjs --tags",
"coverage": "pikku tests coverage",
"tsc": "tsc --noEmit"
},
"dependencies": {
"@pikku/cucumber": "0.12.9",
"@pikku/kysely-node-sqlite": "^0.12.3"
},
"devDependencies": {
"@cucumber/cucumber": "^11.0.0",
"@types/node": "^22",
"c8": "^10.0.0",
"tsx": "^4.21.0",
"typescript": "~5.8.0"
}
}

View File

@@ -0,0 +1,7 @@
export default {
requireModule: ['tsx'],
require: ['tests/support/**/*.ts', 'tests/steps/**/*.ts'],
paths: ['tests/features/**/*.feature'],
format: ['progress', 'html:tests/reports/cucumber-report.html'],
forceExit: true,
}

View File

@@ -0,0 +1,7 @@
import '../../../.pikku/pikku-bootstrap.gen.js'
import { Before, After, BeforeAll, AfterAll, setDefaultTimeout, Given, When, Then } from '@cucumber/cucumber'
import { registerHooks, registerCommonSteps } from '@pikku/cucumber'
import { db } from './services.js'
registerHooks({ Before, After, BeforeAll, AfterAll, setDefaultTimeout }, db)
registerCommonSteps({ Given, When, Then })

View File

@@ -0,0 +1,14 @@
import { createDbUtils, type StubTracker } from '@pikku/cucumber'
import { createConfig } from '../../../src/config.js'
import { createSingletonServices } from '../../../src/services.js'
export const db = createDbUtils({ migrationsDir: '', seedFile: '' })
export async function createStubServices(_dbFile: string, tracker: StubTracker) {
const injected = new Proxy({} as Record<string, unknown>, {
get(_, prop: string) { return tracker.stub(prop) },
})
const config = await createConfig()
const services = await createSingletonServices(config as never, injected as never)
return { services }
}

View File

@@ -0,0 +1,5 @@
import { World, setWorldConstructor } from '@cucumber/cucumber'
import { createFunctionWorld } from '@pikku/cucumber'
import { createStubServices } from './services.js'
createFunctionWorld(World, setWorldConstructor, createStubServices)

View File

@@ -0,0 +1,18 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"types": [
"node"
],
"noEmit": true,
"skipLibCheck": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"strict": true
},
"include": [
"tests/**/*.ts"
]
}