forked from layerx-labs/dappkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbase-model.spec.ts
25 lines (20 loc) · 881 Bytes
/
base-model.spec.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
import {Web3ConnectionOptions} from '@interfaces/web3-connection-options';
import {Web3Connection} from '@base/web3-connection';
import {Model} from '@base/model';
import {expect} from 'chai';
import {Errors} from '@interfaces/error-enum';
import {getPrivateKeyFromFile} from '../utils/';
describe(`Model<any>`, () => {
const options: Web3ConnectionOptions = {
web3Host: process.env.WEB3_HOST_PROVIDER || 'HTTP://127.0.0.1:8545',
privateKey: process.env.WALLET_PRIVATE_KEY || getPrivateKeyFromFile(),
skipWindowAssignment: true,
}
it(`throws because no Abi`, () => {
const web3Connection = new Web3Connection(options);
expect(() => new Model(web3Connection, []))
.to.throw(Errors.MissingAbiInterfaceFromArguments);
expect(() => new Model(web3Connection, undefined as any))
.to.throw(Errors.MissingAbiInterfaceFromArguments);
});
})