added tests

This commit is contained in:
Brian Bjarke Jensen
2025-09-19 19:38:10 +02:00
parent 0abd398c10
commit b426d43de0
16 changed files with 1919 additions and 0 deletions
@@ -0,0 +1,16 @@
name: Test Web Formatting
on:
push:
branches: [main]
pull_request:
jobs:
formatting:
name: Web Formatting
uses: gitea.gt-proj.com/brian/CI-templates/.gitea/workflows/web/formatting.yml@main
with:
node-version: "20"
prettier-config: ".prettierrc.json"
check-yaml: true
check-json: true
+7
View File
@@ -0,0 +1,7 @@
{
"semi": true,
"trailingComma": "es5",
"singleQuote": true,
"printWidth": 80,
"tabWidth": 2
}
+20
View File
@@ -0,0 +1,20 @@
name: Test Web App
description: A simple web application for testing
api:
version: v1
endpoints:
- name: health
path: /health
method: GET
- name: calculator
path: /calculate
method: POST
database:
type: sqlite
name: test.db
logging:
level: info
format: json
+15
View File
@@ -0,0 +1,15 @@
console.log("Hello, World!");
const calculator = {
add: (a, b) => a + b,
subtract: (a, b) => a - b,
multiply: (a, b) => a * b,
divide: (a, b) => {
if (b === 0) {
throw new Error("Cannot divide by zero");
}
return a / b;
},
};
module.exports = calculator;
+18
View File
@@ -0,0 +1,18 @@
{
"name": "test-web-project",
"version": "1.0.0",
"description": "Test web project for CI template validation",
"main": "index.js",
"scripts": {
"start": "node index.js",
"test": "echo \"Error: no test specified\" && exit 1",
"format": "prettier --write .",
"format:check": "prettier --check ."
},
"keywords": ["test", "ci", "templates"],
"author": "Test Author",
"license": "MIT",
"devDependencies": {
"prettier": "^3.0.0"
}
}