<commit_before>import path from "path";
import {assert, test as helpers} from "yeoman-generator";
import os from "os";
import fs from "fs";
import rimraf from "rimraf";
import chai from "chai";

chai.should();

const basePath = path.join(os.tmpdir(), "/temp-test");

describe("oss-component generator", function() {
	let context,
		answers;

	this.timeout(10000); // Yeoman generation can sometimes take longer than 2 seconds. Let's give it 10.

	before(() => {
		answers = {
			"true": {
				"name": "jargon",
				"description": "some description for the component",
				"organizationName": "Free all media",

				"repositoryUrl": "someRepoUrl",
				"issueTrackerUrl": "someIssueTrackerUrl",
				"homepage": "someHomepageanswer",

				"travis": true,

				"floobits": true,
				"floobitsWorkspace": "floobits.com/someFlooobitsWorkspace",

				"sauceLabs": true,
				"sauceLabsAccessToken": "<PASSWORD>ucelabsaccesstokenanswer",
				"sauceLabsUserName": "somesaucelabsusernameanswer",

				"david": true,
				"davidRepo": "david-dm.org/somerepo",

				"codeQuality": "codeClimate",

				"gitHub": true,
				"gitHubAccountName": "FreeAllMedia"
			},
			"false": {
				"name": "jargon",
				"description": "some description for the component",
				"organizationName": "Free all media",

				"repositoryUrl": "someRepoUrl",
				"issueTrackerUrl": "someIssueTrackerUrl",
				"homepage": "someHomepageanswer",

				"travis": false,

				"floobits": false,

				"sauceLabs": false,

				"david": false,

				"codeQuality": "none",

				"gitHub": false
			}
		};
	});

	describe("(with all false)", () => {

		before(done => {
			//create initial files and dires with a certain content
			rimraf(basePath, () => {
				context = helpers.run(path.join(__dirname, "../../generators/app"))
					.inDir(basePath)
					.withOptions({ "skip-install": true })
					.withPrompts(answers.false)
					.on("end", done);
			});
		});

		describe("(general information)", () => {
			it("should set name property correctly", () => {
				console.log("context is ", context.generator.context);
				context.generator.context.name.should.equal(answers.false.name);
			});

			it("should set description property correctly", () => {
				context.generator.context.description.should.equal(answers.false.description);<commit_msg>remove log<commit_after>import path from "path";
import {assert, test as helpers} from "yeoman-generator";
import os from "os";
import fs from "fs";
import rimraf from "rimraf";
import chai from "chai";

chai.should();

const basePath = path.join(os.tmpdir(), "/temp-test");

describe("oss-component generator", function() {
	let context,
		answers;

	this.timeout(10000); // Yeoman generation can sometimes take longer than 2 seconds. Let's give it 10.

	before(() => {
		answers = {
			"true": {
				"name": "jargon",
				"description": "some description for the component",
				"organizationName": "Free all media",

				"repositoryUrl": "someRepoUrl",
				"issueTrackerUrl": "someIssueTrackerUrl",
				"homepage": "someHomepageanswer",

				"travis": true,

				"floobits": true,
				"floobitsWorkspace": "floobits.com/someFlooobitsWorkspace",

				"sauceLabs": true,
				"sauceLabsAccessToken": "some<PASSWORD>accesstoken<PASSWORD>",
				"sauceLabsUserName": "somesaucelabsusernameanswer",

				"david": true,
				"davidRepo": "david-dm.org/somerepo",

				"codeQuality": "codeClimate",

				"gitHub": true,
				"gitHubAccountName": "FreeAllMedia"
			},
			"false": {
				"name": "jargon",
				"description": "some description for the component",
				"organizationName": "Free all media",

				"repositoryUrl": "someRepoUrl",
				"issueTrackerUrl": "someIssueTrackerUrl",
				"homepage": "someHomepageanswer",

				"travis": false,

				"floobits": false,

				"sauceLabs": false,

				"david": false,

				"codeQuality": "none",

				"gitHub": false
			}
		};
	});

	describe("(with all false)", () => {

		before(done => {
			//create initial files and dires with a certain content
			rimraf(basePath, () => {
				context = helpers.run(path.join(__dirname, "../../generators/app"))
					.inDir(basePath)
					.withOptions({ "skip-install": true })
					.withPrompts(answers.false)
					.on("end", done);
			});
		});

		describe("(general information)", () => {
			it("should set name property correctly", () => {
				context.generator.context.name.should.equal(answers.false.name);
			});

			it("should set description property correctly", () => {
				context.generator.context.description.should.equal(answers.false.description);
{'fraction_non_alphanumeric': 0.1636924432694426, 'fraction_numerical': 0.003525005507821106, 'mean_word_length': 3.824654622741764, 'pattern_counts': {'":': 64, '<': 6, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5869690', 'n_tokens_mistral': 1815, 'n_tokens_neox': 1455, 'n_words': 331}