Skip to content

Commit

Permalink
fix problem with multiple files in web3 target
Browse files Browse the repository at this point in the history
  • Loading branch information
krzkaczor committed Sep 17, 2018
1 parent 75dd916 commit f89c47c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,8 @@
# Changelog

### Bugfix
- web3 target supports multiple files now

## [0.3.4] - 2018-09-13
### Changed
- fix regression in legacy target
Expand Down
2 changes: 1 addition & 1 deletion lib/targets/web3/index.ts
Expand Up @@ -36,7 +36,7 @@ export class Web3 extends TsGeneratorPlugin {
const contract = parse(abi, name);

return {
path: join(this.outDirAbs, `${name}.ts`),
path: join(this.outDirAbs, `${name}.d.ts`),
contents: codegen(contract),
};
}
Expand Down
@@ -0,0 +1,13 @@
import { deployContract, accounts } from "./web3";
import { DumbContract } from "./types/web3-contracts/DumbContract";

import { expect } from "chai";
import { ContractWithOverloads } from "./types/web3-contracts/ContractWithOverloads";

describe("ContractWithOverloads", () => {
it("should work", async () => {
const contract = (await deployContract("ContractWithOverloads")) as ContractWithOverloads;

expect(await contract.methods.counter().call({ from: accounts[0] })).to.be.deep.eq("0");
});
});
@@ -1,5 +1,5 @@
import { deployContract, accounts } from "./web3";
import { DumbContract } from "./types/web3-contracts";
import { DumbContract } from "./types/web3-contracts/DumbContract";

import { expect } from "chai";

Expand Down
2 changes: 1 addition & 1 deletion test/integration/targets/web3-1.0.0/package.json
Expand Up @@ -18,7 +18,7 @@
},
"scripts": {
"tsc": "tsc --noEmit",
"mocha": "NODE_ENV=test mocha --require ts-node/register.js './**/*.spec2.ts'",
"mocha": "NODE_ENV=test mocha --require ts-node/register.js './**/*.spec.web3.ts'",
"test": "yarn tsc && yarn mocha"
}
}

0 comments on commit f89c47c

Please sign in to comment.