2023-12-27 07:10:24 +01:00
|
|
|
/*
|
2024-02-12 03:37:45 +01:00
|
|
|
* SPDX-FileCopyrightText: syuilo and misskey-project
|
2023-12-27 07:10:24 +01:00
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
|
|
|
process.env.NODE_ENV = 'test';
|
|
|
|
|
|
|
|
import * as assert from 'assert';
|
2024-01-08 09:43:52 +01:00
|
|
|
import { relativeFetch } from '../utils.js';
|
2023-12-27 07:10:24 +01:00
|
|
|
|
|
|
|
describe('nodeinfo', () => {
|
|
|
|
test('nodeinfo 2.1', async () => {
|
|
|
|
const res = await relativeFetch('nodeinfo/2.1');
|
|
|
|
assert.ok(res.ok);
|
|
|
|
assert.strictEqual(res.headers.get('Access-Control-Allow-Origin'), '*');
|
|
|
|
|
2024-03-15 05:08:54 +01:00
|
|
|
const nodeInfo = await res.json() as FIXME;
|
2023-12-27 07:10:24 +01:00
|
|
|
assert.strictEqual(nodeInfo.software.name, 'misskey');
|
|
|
|
});
|
|
|
|
|
|
|
|
test('nodeinfo 2.0', async () => {
|
|
|
|
const res = await relativeFetch('nodeinfo/2.0');
|
|
|
|
assert.ok(res.ok);
|
|
|
|
assert.strictEqual(res.headers.get('Access-Control-Allow-Origin'), '*');
|
|
|
|
|
2024-03-15 05:08:54 +01:00
|
|
|
const nodeInfo = await res.json() as FIXME;
|
2023-12-27 07:10:24 +01:00
|
|
|
assert.strictEqual(nodeInfo.software.name, 'misskey');
|
|
|
|
});
|
|
|
|
});
|