castAsError
This commit is contained in:
parent
a28ca99a1b
commit
8c777feb91
|
@ -10,7 +10,7 @@ import * as assert from 'assert';
|
||||||
// https://github.com/node-fetch/node-fetch/pull/1664
|
// https://github.com/node-fetch/node-fetch/pull/1664
|
||||||
import { Blob } from 'node-fetch';
|
import { Blob } from 'node-fetch';
|
||||||
import { MiUser } from '@/models/_.js';
|
import { MiUser } from '@/models/_.js';
|
||||||
import { api, initTestDb, post, signup, simpleGet, uploadFile } from '../utils.js';
|
import {api, castAsError, initTestDb, post, signup, simpleGet, uploadFile} from '../utils.js';
|
||||||
import type * as misskey from 'misskey-js';
|
import type * as misskey from 'misskey-js';
|
||||||
|
|
||||||
describe('Endpoints', () => {
|
describe('Endpoints', () => {
|
||||||
|
@ -285,7 +285,8 @@ describe('Endpoints', () => {
|
||||||
}, alice);
|
}, alice);
|
||||||
|
|
||||||
assert.strictEqual(res.status, 400);
|
assert.strictEqual(res.status, 400);
|
||||||
assert.strictEqual(res.body.error.code, 'CANNOT_REACT_TO_RENOTE');
|
assert.ok(res.body);
|
||||||
|
assert.strictEqual(castAsError(res.body).error.code, 'CANNOT_REACT_TO_RENOTE');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('引用にリアクションできる', async () => {
|
test('引用にリアクションできる', async () => {
|
||||||
|
|
Loading…
Reference in New Issue