just work already

This commit is contained in:
Pavel Murygin 2022-02-21 18:27:23 +03:00
parent 2d6ea386d8
commit 8dc050b1d1
7 changed files with 13412 additions and 16988 deletions

View File

@ -0,0 +1,8 @@
module.exports = {
semi: true,
trailingComma: 'all',
singleQuote: true,
printWidth: 120,
tabWidth: 4,
useTabs: false,
};

View File

@ -7,7 +7,24 @@ describe('smoke test', () => {
await main(krasnodar);
expect(console.log).toBeCalledTimes(0);
// TODO::
});
expect(console.log).toBeCalledTimes(16);
expect(console.log).toHaveBeenNthCalledWith(
13,
'📗 uploaded file:',
expect.objectContaining({
path: 'NZgK6DB.png',
size: expect.any(Number),
cid: expect.anything(),
}),
);
expect(console.log).toHaveBeenNthCalledWith(
15,
'📗 File size is saved to IPFS:',
expect.objectContaining({
error: '',
hash: expect.any(String),
success: true,
}),
);
}, 20000);
});

View File

@ -58,6 +58,8 @@ export async function main(environment: Node[]) {
);
service_id = fromOption(service_id);
if (service_id === null) {
await Fluence.stop();
await providerClient.stop();
return;
}
@ -83,7 +85,9 @@ export async function main(environment: Node[]) {
let result = await remove_service(serviceHost.peerId, service_id);
console.log('📗 ProcessFiles service removed', result);
return;
await Fluence.stop();
await providerClient.stop();
}
function fromOption<T>(opt: T | T[] | null): T | null {

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff