refactored adapters to run test suites (#126)

* refactored adapters to run test suites

* fix bun version for tests

* added missing adapter tests and refactored examples to use `bknd.config.ts` where applicable
This commit is contained in:
dswbx
2025-04-01 11:43:11 +02:00
committed by GitHub
parent 36e4224b33
commit 3f26c45dd9
55 changed files with 1130 additions and 647 deletions

View File

@@ -1,6 +1,6 @@
import { serveLambda } from "bknd/adapter/aws";
import { serve } from "bknd/adapter/aws";
export const handler = serveLambda({
export const handler = serve({
// to get local assets, run `npx bknd copy-assets`
// this is automatically done in `deploy.sh`
assets: {

View File

@@ -1,21 +1,21 @@
{
"name": "aws-lambda",
"version": "1.0.0",
"main": "index.mjs",
"scripts": {
"test": "esbuild index.mjs --bundle --format=cjs --platform=node --external:fs --outfile=dist/index.js && node test.js",
"deploy": "./deploy.sh",
"clean": "./clean.sh"
},
"keywords": [],
"author": "",
"license": "ISC",
"description": "",
"dependencies": {
"bknd": "file:../../app/bknd-0.9.0-rc.1-11.tgz"
},
"devDependencies": {
"esbuild": "^0.25.0",
"dotenv": "^16.4.7"
}
"name": "aws-lambda",
"version": "1.0.0",
"main": "index.mjs",
"scripts": {
"test": "esbuild index.mjs --bundle --format=cjs --platform=node --external:fs --outfile=dist/index.js && node test.js",
"deploy": "./deploy.sh",
"clean": "./clean.sh"
},
"keywords": [],
"author": "",
"license": "ISC",
"description": "",
"dependencies": {
"bknd": "file:../../app"
},
"devDependencies": {
"esbuild": "^0.25.0",
"dotenv": "^16.4.7"
}
}

View File

@@ -3,11 +3,11 @@ const handler = require("./dist/index.js").handler;
const event = {
httpMethod: "GET",
path: "/",
//path: "/api/system/config",
//path: "/",
path: "/api/system/config",
//path: "/assets/main-B6sEDlfs.js",
headers: {
//"Content-Type": "application/json",
"Content-Type": "application/json",
"User-Agent": "curl/7.64.1",
Accept: "*/*",
},