-
Notifications
You must be signed in to change notification settings - Fork 22
/
files.test.ts
40 lines (36 loc) · 1.36 KB
/
files.test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { loadAbiFile } from '../../src/abi/files';
import { join } from 'path';
describe('loadAbiFile', () => {
it('loads raw ABI file', async () => {
const result = await loadAbiFile(join(__dirname, '../abis/BCB.json'), {
decodeAnonymous: false,
fingerprintContracts: true,
directory: join(__dirname, '../abis'),
requireContractMatch: true,
reconcileStructShapeFromTuples: false,
});
expect(result).toMatchSnapshot();
});
it('loads truffle build file', async () => {
await expect(
loadAbiFile(join(__dirname, '../abis/Airdropper.json'), {
decodeAnonymous: false,
fingerprintContracts: true,
directory: join(__dirname, '..'),
requireContractMatch: true,
reconcileStructShapeFromTuples: false,
})
).resolves.toMatchSnapshot();
});
it('loads EventEmitter.json', async () => {
await expect(
loadAbiFile(join(__dirname, '../abis/EventEmitter.json'), {
decodeAnonymous: false,
fingerprintContracts: true,
directory: join(__dirname, '..'),
requireContractMatch: true,
reconcileStructShapeFromTuples: false,
})
).resolves.toMatchSnapshot();
});
});