8 Commits

Author SHA1 Message Date
fa126e02de actions: correct browser
All checks were successful
IPWA Tests / Run Angular tests (22) (push) Successful in 5m12s
2025-06-19 10:55:03 +02:00
a65baa06fd actions: add karma config
Some checks failed
IPWA Tests / Run Angular tests (22) (push) Failing after 4m3s
2025-06-19 10:45:17 +02:00
da8c21eb0d actions:test
Some checks failed
IPWA Tests / Run Angular tests (22) (push) Failing after 2m16s
2025-06-19 10:29:11 +02:00
2e42f65d88 actions: add chrome path
Some checks failed
IPWA Tests / Run Angular tests (22) (push) Failing after 4m3s
2025-06-19 10:18:20 +02:00
33eef9d305 actions: deps
Some checks failed
IPWA Tests / Run Angular tests (22) (push) Failing after 12m13s
2025-06-18 22:33:55 +02:00
6a145b224c actions: setup chrome
Some checks failed
IPWA Tests / Run Angular tests (22) (push) Failing after 2m34s
2025-06-18 20:37:17 +02:00
913ccd0bf1 actions: update matrix
Some checks failed
IPWA Tests / Run Angular tests (22) (push) Failing after 2m3s
2025-06-18 19:40:28 +02:00
271ba89704 actions: Add tests
Some checks failed
IPWA Tests / Run Angular tests (22) (push) Failing after 1m6s
2025-06-18 19:38:12 +02:00
4 changed files with 89 additions and 1 deletions

View File

@@ -0,0 +1,42 @@
name: IPWA Tests
run-name: ${{ gitea.actor }} is testing out IPWA
on: [push]
jobs:
Run Angular tests:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22]
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Cache node modules
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{matrix.node-version}}
cache: 'npm'
cache-dependency-path: package-lock.json
- name: Setup Chrome
uses: browser-actions/setup-chrome@v1.7.3
id: setup-chrome
with:
install-dependencies: true
- name: Install node dependencies
run: npm ci
- name: Echo chrome path
run: |
echo "$CHROME_BIN"
env:
CHROME_BIN: ${{steps.setup-chrome.outputs.chrome-path}}
- name: Run tests
run: npm run ci
env:
CHROME_BIN: ${{steps.setup-chrome.outputs.chrome-path}}

View File

@@ -128,6 +128,7 @@
"zone.js/testing"
],
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"inlineStyleLanguage": "scss",
"assets": [
"src/favicon.ico",

45
karma.conf.js Normal file
View File

@@ -0,0 +1,45 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
jasmine: {
// you can add configuration options for Jasmine here
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
// for example, you can disable the random execution with `random: false`
// or set a specific seed with `seed: 4321`
},
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
jasmineHtmlReporter: {
suppressAll: true // removes the duplicated traces
},
coverageReporter: {
dir: require('path').join(__dirname, './coverage/ipwa'),
subdir: '.',
reporters: [
{ type: 'html' },
{ type: 'text-summary' }
]
},
reporters: ['progress', 'kjhtml'],
browsers: ['Chrome'],
restartOnFileChange: true,
customLaunchers: {
ChromeHeadlessCustom: {
base: "ChromeHeadless",
flags: ["--no-sandbox", "--disable-gpu"],
},
},
});
};

View File

@@ -8,7 +8,7 @@
"build": "ng build -c production",
"watch": "ng build --watch --configuration development",
"test": "ng test",
"ci": "ng test --no-watch --no-progress --browsers=ChromiumHeadless"
"ci": "ng test --no-watch --no-progress --browsers=ChromeHeadlessCustom"
},
"private": true,
"dependencies": {