Skip to content

Commit

Permalink
fix(tests): add esm tests and remove redundant cjs tests
Browse files Browse the repository at this point in the history
  • Loading branch information
atticusofsparta committed Oct 16, 2024
1 parent f999c49 commit d84d709
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 34 deletions.
24 changes: 0 additions & 24 deletions tests/e2e/cjs/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,28 +406,4 @@ describe('ANT', async () => {
const record = await ant.getRecord({ undername: 'ardrive' }, { strict });
assert(record);
});
it(`should be able to read methods when strict is false`, async () => {
const strict = false;
const ant = ANT.init({
processId,
ao: aoClient,
});
const state = await ant.getState({ strict });
assert(state);
const info = await ant.getInfo({ strict });
assert(info);
const balance = await ant.getBalance(
{ address: '7waR8v4STuwPnTck1zFVkQqJh5K9q9Zik4Y5-5dV7nk' },
{ strict },
);
assert(balance);
const balances = await ant.getBalances({ strict });
assert(balances);
const controllers = await ant.getControllers({ strict });
assert(controllers);
const records = await ant.getRecords({ strict });
assert(records);
const record = await ant.getRecord({ undername: 'ardrive' }, { strict });
assert(record);
});
});
22 changes: 12 additions & 10 deletions tests/e2e/esm/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,15 +399,14 @@ describe('ANT', async () => {
const processId = 'YcxE5IbqZYK72H64ELoysxiJ-0wb36deYPv55wgl8xo';
const ant = ANT.init({
processId,
strict: true,
});

it('should be able to create ANTWriteable with valid signers', async () => {
for (const signer of signers) {
const nonStrictAnt = ANT.init({
processId,
signer,
strict: true,
strict: false,
});
const strictAnt = ANT.init({
processId,
Expand All @@ -421,17 +420,17 @@ describe('ANT', async () => {
});

it('should be able to get ANT info', async () => {
const info = await ant.getInfo({ processId });
const info = await ant.getInfo({ strict: true });
assert.ok(info);
});

it('should be able to get the ANT records', async () => {
const records = await ant.getRecords({ processId });
const records = await ant.getRecords({ strict: true }, { strict: true });
assert.ok(records);
});

it('should be able to get a @ record from the ANT', async () => {
const record = await ant.getRecord({ undername: '@' });
const record = await ant.getRecord({ undername: '@' }, { strict: true });
assert.ok(record);
});

Expand All @@ -456,19 +455,22 @@ describe('ANT', async () => {
});

it('should be able to get the ANT state', async () => {
const state = await ant.getState();
const state = await ant.getState({ strict: true });
assert.ok(state);
});

it('should be able to get the ANT balance for an address', async () => {
const balance = await ant.getBalance({
address: '"7waR8v4STuwPnTck1zFVkQqJh5K9q9Zik4Y5-5dV7nk',
});
const balance = await ant.getBalance(
{
address: '7waR8v4STuwPnTck1zFVkQqJh5K9q9Zik4Y5-5dV7nk',
},
{ strict: true },
);
assert.notEqual(balance, undefined);
});

it('should be able to get the ANT balances', async () => {
const balances = await ant.getBalances();
const balances = await ant.getBalances({ strict: true });
assert.ok(balances);
});
});

0 comments on commit d84d709

Please sign in to comment.