Website monitor via HeroUnion.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.1 KiB

6 months ago
/**
* Monitor测试用例
*/
import test from 'node:test';
import assert from 'node:assert';
import axios from 'axios';
import common from '../lib/common.mjs';
import Monitor from '../monitor.mjs';
const axiosConfig = {
timeout: 5000,
proxy: false
};
test('common.createHeroUnionTask test', async (t) => {
let configFile = 'config_test.json';
let configs = await common.getConfigFromJsonFile(configFile);
console.log("configs from %s", configFile, configs);
let targetUrl = 'https://tajian.tv';
let notifyUrl = '';
let taskRes = await common.createHeroUnionTask(targetUrl, notifyUrl, configs);
console.log("Task create result", taskRes);
assert.equal(taskRes.code, 1);
});
test('common.queryHeroUnionTask test', async (t) => {
let configFile = 'config_test.json';
let configs = await common.getConfigFromJsonFile(configFile);
console.log("configs from %s", configFile, configs);
let task_id = 'machete_tajian_1717495858207';
let taskRes = await common.queryHeroUnionTask(task_id, configs);
console.log("Task data", taskRes);
assert.equal(taskRes.code, 1);
});