Skip to content

Commit

Permalink
chore: move deployer to the describe context
Browse files Browse the repository at this point in the history
  • Loading branch information
Gusarich authored Oct 25, 2023
1 parent 92c3644 commit a7f9f93
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/templates/func/counter/tests/spec.ts.template
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ describe('{{name}}', () => {
});

let blockchain: Blockchain;
let deployer: SandboxContract<TreasuryContract>;
let {{loweredName}}: SandboxContract<{{name}}>;

beforeEach(async () => {
Expand All @@ -28,7 +29,7 @@ describe('{{name}}', () => {
)
);

const deployer = await blockchain.treasury('deployer');
deployer = await blockchain.treasury('deployer');

const deployResult = await {{loweredName}}.sendDeploy(deployer.getSender(), toNano('0.05'));

Expand Down
3 changes: 2 additions & 1 deletion src/templates/func/empty/tests/spec.ts.template
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ describe('{{name}}', () => {
});

let blockchain: Blockchain;
let deployer: SandboxContract<TreasuryContract>;
let {{loweredName}}: SandboxContract<{{name}}>;

beforeEach(async () => {
blockchain = await Blockchain.create();

{{loweredName}} = blockchain.openContract({{name}}.createFromConfig({}, code));

const deployer = await blockchain.treasury('deployer');
deployer = await blockchain.treasury('deployer');

const deployResult = await {{loweredName}}.sendDeploy(deployer.getSender(), toNano('0.05'));

Expand Down
3 changes: 2 additions & 1 deletion src/templates/tact/counter/tests/spec.ts.template
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ import '@ton/test-utils';

describe('{{name}}', () => {
let blockchain: Blockchain;
let deployer: SandboxContract<TreasuryContract>;
let {{loweredName}}: SandboxContract<{{name}}>;

beforeEach(async () => {
blockchain = await Blockchain.create();

{{loweredName}} = blockchain.openContract(await {{name}}.fromInit(0n));

const deployer = await blockchain.treasury('deployer');
deployer = await blockchain.treasury('deployer');

const deployResult = await {{loweredName}}.send(
deployer.getSender(),
Expand Down
3 changes: 2 additions & 1 deletion src/templates/tact/empty/tests/spec.ts.template
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ import '@ton/test-utils';

describe('{{name}}', () => {
let blockchain: Blockchain;
let deployer: SandboxContract<TreasuryContract>;
let {{loweredName}}: SandboxContract<{{name}}>;

beforeEach(async () => {
blockchain = await Blockchain.create();

{{loweredName}} = blockchain.openContract(await {{name}}.fromInit());

const deployer = await blockchain.treasury('deployer');
deployer = await blockchain.treasury('deployer');

const deployResult = await {{loweredName}}.send(
deployer.getSender(),
Expand Down

0 comments on commit a7f9f93

Please sign in to comment.