Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Add an integration test for truffle init #1479

Merged
merged 1 commit into from
Nov 29, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions packages/truffle/test/scenarios/commands/init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
const assert = require("assert");
const CommandRunner = require("../commandrunner");
const path = require("path");
const tmp = require("tmp");
const fs = require("fs");

describe("truffle init", () => {
let tempDir, config;

beforeEach(() => {
tempDir = tmp.dirSync({ unsafeCleanup: true });
config = {
working_directory: tempDir.name,
logger: { log: () => {} }
};
});
afterEach(() => {
tempDir.removeCallback();
});

it("does not error", done => {
CommandRunner.run("init", config, error => {
assert(typeof error === "undefined");
done();
});
}).timeout(30000);

it("unboxes a project with a truffle config", done => {
CommandRunner.run("init", config, () => {
assert(fs.existsSync(path.join(tempDir.name, "truffle-config.js")));
done();
});
}).timeout(20000);
});