forked from ton-community/compressed-nft-contract
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Item.spec.ts
38 lines (29 loc) · 1.06 KB
/
Item.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
26
27
28
29
30
31
32
33
34
35
36
37
38
import { Blockchain, SandboxContract } from '@ton-community/sandbox';
import { Cell, toNano } from 'ton-core';
import { Item } from '../wrappers/Item';
import '@ton-community/test-utils';
import { compile } from '@ton-community/blueprint';
describe('Item', () => {
let code: Cell;
beforeAll(async () => {
code = await compile('Item');
});
let blockchain: Blockchain;
let item: SandboxContract<Item>;
beforeEach(async () => {
blockchain = await Blockchain.create();
item = blockchain.openContract(Item.createFromConfig({}, code));
const deployer = await blockchain.treasury('deployer');
const deployResult = await item.sendDeploy(deployer.getSender(), toNano('0.05'));
expect(deployResult.transactions).toHaveTransaction({
from: deployer.address,
to: item.address,
deploy: true,
success: true,
});
});
it('should deploy', async () => {
// the check is done inside beforeEach
// blockchain and item are ready to use
});
});