Skip to content

Commit

Permalink
remove unnecessart await
Browse files Browse the repository at this point in the history
  • Loading branch information
mjlescano committed Oct 17, 2024
1 parent d5e3253 commit 63b509b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/repo/test/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
/* eslint-disable @typescript-eslint/no-floating-promises */

import { describe, before, it, TestContext } from 'node:test';
import axios, { AxiosInstance } from 'axios';
import { uncompress } from '@usecannon/builder/dist/src/ipfs';
import { repoServerMock } from './helpers/repo-server';
import { ipfsServerMock } from './helpers/ipfs-server-mock';
import { redisServerMock } from './helpers/redis-server-mock';

void describe('POST /api/v0/cat', async function () {
describe('POST /api/v0/cat', async function () {
let repo: AxiosInstance;

before(async function () {
Expand All @@ -17,19 +19,19 @@ void describe('POST /api/v0/cat', async function () {
});
});

await it('should return 400 on missing ipfshash', async function (t: TestContext) {
it('should return 400 on missing ipfshash', async function (t: TestContext) {
const res = await repo.post('/api/v0/cat');
t.assert.strictEqual(res.status, 400);
t.assert.strictEqual(res.data, 'argument "ipfs-path" is required');
});

await it('should return 404 on unregistered ipfshash', async function (t: TestContext) {
it('should return 404 on unregistered ipfshash', async function (t: TestContext) {
const res = await repo.post('/api/v0/cat?arg=QmPK1s3pNYLi9ERiq3BDxKa4XosgWwFRQUydHUtz4YgpqB');
t.assert.strictEqual(res.status, 404);
t.assert.strictEqual(res.data, 'unregistered ipfs data');
});

await it('should return a pinned file that is not registered', async function (t: TestContext) {
it('should return a pinned file that is not registered', async function (t: TestContext) {
const res = await repo.post(
'/api/v0/cat?arg=QmYrLsLZwGGg68XwGkdrx8q9KaRSHq7e5sa6PbT7kNXjKw',
{},
Expand Down

0 comments on commit 63b509b

Please sign in to comment.