Skip to content

Commit

Permalink
Merge pull request #65 from rlay-project/test/issue-64
Browse files Browse the repository at this point in the history
test(bug): add failing test for #64
  • Loading branch information
hobofan authored Jul 17, 2019
2 parents 142204a + 2c65a57 commit 61865b7
Showing 1 changed file with 27 additions and 6 deletions.
33 changes: 27 additions & 6 deletions test/integration/02_rlay_generate/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,23 @@ describe("rlay-generate", () => {
});

it("correctly generates rlay-client file", () => {
const seedFileOutputPath = path.join(__dirname, "./data/seed_output.json");
const seedFileOutputPath = path.join(
__dirname,
"./data/seed_output.json"
);
const seedFilePath = path.join(__dirname, "./data/seed.js");
const outputPath = path.join(__dirname, "./data/rlay-client.js");

const cmdResult = childProcess.spawnSync(
babelNodeCmdPath,
[
rlayGenerateCmdPath,
"--seed-file-output", seedFileOutputPath,
"--seed-file", seedFilePath,
"--output", outputPath,
rlayGenerateCmdPath,
"--seed-file-output",
seedFileOutputPath,
"--seed-file",
seedFilePath,
"--output",
outputPath
],
{ encoding: "utf-8" }
);
Expand All @@ -46,9 +52,24 @@ describe("rlay-generate", () => {
const indi = await client.Individual.create({
httpConnectionClass: true
});
const assertCid = '0x019680031b2004db02acb784cda01405eb1148592070fc27e5ae608a96efa94d4cc4698013be';
const assertCid =
"0x019680031b2004db02acb784cda01405eb1148592070fc27e5ae608a96efa94d4cc4698013be";

assert.equal(indi.cid, assertCid);
});

it.skip("can create Entities with different values", async () => {
const outputPath = path.join(__dirname, "./data/rlay-client.js");
const client = require(outputPath);

const indi1 = await client.Individual.create({
httpConnectionClass: true
});
const indi2 = await client.Individual.create({
httpConnectionClass: false
});

assert.notEqual(indi1.cid, indi2.cid);
});
});
});

0 comments on commit 61865b7

Please sign in to comment.