Skip to content

Commit

Permalink
fixes factory retrieving
Browse files Browse the repository at this point in the history
  • Loading branch information
aquiladev committed Mar 5, 2020
1 parent 2dce438 commit e336f40
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion updater/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = {
validate(options);

const { name, contentHash } = options;
const factory = tldMap.find(tld => name.endsWith(tld.name));
const { factory } = tldMap.find(tld => name.endsWith(tld.name));
const updater = await factory(options);

let currentContenthash;
Expand Down
14 changes: 14 additions & 0 deletions updater/index.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const updater = require('./');

jest.setTimeout(120000);

test('throws when unknown name', async () => {
await expect(updater.update({}))
.rejects.toThrow('Name is unknown or empty');
Expand All @@ -18,4 +20,16 @@ test('throws when not supported TLD', async () => {
test('throws when contentHash is empty', async () => {
await expect(updater.update({ name: 'test.eth' }))
.rejects.toThrow('ContentHash is unknown or empty');
});

describe.only('Updater: Integration tests', () => {
test('test', async () => {
await updater.update({
mnemonic: process.env.DEV_PKEY,
rpc: `https://mainnet.infura.io/v3/${process.env.INFURA_API_KEY}`,
name: 'ddns-action.eth',
contentHash: 'QmRJFpRntf1EMgmC5Tm3Rzc438PRrYCMYZPb6nD4DeaNH6',
verbose: true
});
});
});

0 comments on commit e336f40

Please sign in to comment.