UNPKG

truffle

Version:

Truffle - Simple development framework for Ethereum

46 lines (40 loc) 1.35 kB
const MemoryLogger = require("../MemoryLogger"); const CommandRunner = require("../commandRunner"); const assert = require("assert"); const Server = require("../server"); const path = require("path"); const sandbox = require("../sandbox"); const fs = require("fs-extra"); describe("Genesis time config for truffle test, failing tests [ @standalone ]", function () { const logger = new MemoryLogger(); let config, cleanupSandboxDir; before(async function () { await Server.start(); }); after(async function () { await Server.stop(); }); describe("test with a bad time stamp", function () { before(async function () { this.timeout(10000); let project = path.join( __dirname, "../../sources/genesis_time/genesis_time_invalid" ); ({ config, cleanupSandboxDir } = await sandbox.create(project)); config.network = "test"; config.logger = logger; // create test directory await fs.ensureDir(config.test_directory); }); after(function () { cleanupSandboxDir(); }); it("runs test and output whines about invalid date", async function () { this.timeout(90000); await CommandRunner.run("test", config); const output = logger.contents(); assert(output.includes("Invalid Date passed to genesis-time")); }); }); });