Skip to content

Commit

Permalink
add tests on worker package
Browse files Browse the repository at this point in the history
  • Loading branch information
Joao Pedro da Silva authored and Bernardo Vieira committed Oct 4, 2023
1 parent 19821f1 commit 87804bb
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 12 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { SinonStub, assert, match, restore, stub } from 'sinon';
import { config, contracts, database, services, tests } from '../../../';
import { config, contracts, database, services, tests } from '@impactmarket/core';
import { ethers } from 'ethers';
import ganache from 'ganache';

import { ChainSubscribers } from '../../../src/subscriber/chainSubscribers';
import { ChainSubscribers } from '../src/chainSubscribers';
import CommunityAdminContractJSON from './CommunityAdmin.json';
import cUSDContractJSON from './cUSD.json';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import { ChainSubscribers } from '../../../src/subscriber/chainSubscribers';
import { NotificationType } from '../../../src/interfaces/app/appNotification';
import { ChainSubscribers } from '../src/chainSubscribers';
import { Sequelize } from 'sequelize';
import { SinonStub, assert, restore, stub } from 'sinon';
import { config, database, tests } from '../../../';
import { config, database, tests, utils, interfaces } from '@impactmarket/core';
import { ethers } from 'ethers';
import { client as prismic } from '../../../src/utils/prismic';
import { sequelizeSetup, truncate } from '../../config/sequelizeSetup';
import MicrocreditJSON from './Microcredit.json';
import admin from 'firebase-admin';
import ganache from 'ganache';
Expand All @@ -24,7 +21,7 @@ describe.skip('Microcredit', () => {
});

before(async () => {
sequelize = sequelizeSetup();
sequelize = tests.config.setup.sequelizeSetup();
await sequelize.sync();
provider = new ethers.providers.Web3Provider(ganacheProvider as any);
accounts = await provider.listAccounts();
Expand All @@ -43,7 +40,7 @@ describe.skip('Microcredit', () => {
set: async () => null
});

stub(prismic, 'getAllByType').returns(
stub(utils.prismic.client, 'getAllByType').returns(
Promise.resolve([
{
data: {
Expand Down Expand Up @@ -78,8 +75,8 @@ describe.skip('Microcredit', () => {
subscribers.stop();
}
provider.removeAllListeners();
await truncate(sequelize, 'appUser');
await truncate(sequelize);
await tests.config.setup.truncate(sequelize, 'appUser');
await tests.config.setup.truncate(sequelize);
restore();
});

Expand Down Expand Up @@ -111,7 +108,7 @@ describe.skip('Microcredit', () => {
assert.calledWith(notificationUpdated.getCall(0), [
{
userId: user.id,
type: NotificationType.LOAN_APPLICATION_APPROVED,
type: interfaces.app.appNotification.NotificationType.LOAN_APPLICATION_APPROVED,
isWallet: true,
isWebApp: true,
params: undefined
Expand Down

0 comments on commit 87804bb

Please sign in to comment.