Skip to content

Repository files, collaboration, releases and project activity.

archforge-external-status / tests/archforge-git-migration.test.jsmain
▤ tests/archforge-git-migration.test.js1042 bytes
19 lines · Select a line number for a permalink
1'use strict';
2const {test}=require('node:test');const assert=require('node:assert/strict');
3const fs=require('node:fs'),path=require('node:path');
4const {runProbe,serviceDefinitions}=require('../src/probes');
5const cfg={websiteHost:'archforge.nl',api:'',gitHttp:'https://archforge.nl/archadmin/demo.archforge/info/refs'};
6test('native ArchForge HTTPS monitoring target recognized',()=>{
7 assert.equal(serviceDefinitions(cfg).find(s=>s.id==='git_http').configured,true);
8});
9test('legacy .git ArchForge target not presented as configured',()=>{
10 assert.equal(serviceDefinitions({...cfg,gitHttp:'https://archforge.nl/archadmin/demo.git/info/refs'}).find(s=>s.id==='git_http').configured,false);
11});
12test('migration helper only changes approved ArchForge repository origin',()=>{
13 const file=fs.readFileSync(path.join(__dirname,'../migrate-archforge-remote.sh'),'utf8');
14 assert.match(file,/git ls-remote/);
15 assert.match(file,/git remote set-url origin/);
16 assert.match(file,/\.archforge/);
17 assert.doesNotMatch(file,/rm -rf.*status\.db/);
18});