Skip to content
Merged

yarn #82

Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ travis
yarn-skip
force
forcef
force-f
force-f
yarn-skip
2 changes: 1 addition & 1 deletion build-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ var cli = function cli() {
};

install = function install() {
return program.yarn ? "yarn add" : "npm install";
return program.yarn ? "yarn" : "npm install";
};

enterFolder = function enterFolder(str, post) {
Expand Down
11 changes: 11 additions & 0 deletions index-tests/yarn-skip.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { doesFileExist, cli } from "./utils";

test.skip("when passing -y, and -s yarn should be used to init, but no node_modules should be there", async () => {
const folder = "yarn-skip";
process.argv.push(folder);
process.argv.push("-y");
process.argv.push("-s");
await cli();
const areNodeModulesThere = await doesFileExist(`${folder}/node_modules`);
expect(areNodeModulesThere).not.toBeTruthy();
});
18 changes: 5 additions & 13 deletions index-tests/yarn.spec.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
import { executeBashFunction, executeBuild, doesFileExist } from "./utils";
import { doesFileExist, cli } from "./utils";

test.skip("when passing -y, yarn should be used.", async () => {
const folder = "yarn";
await executeBashFunction(`node main.js ${folder} -y`);
await executeBuild(folder);
process.argv.push(folder);
process.argv.push("-y");
await cli();
const doesYarnLockExist = await doesFileExist(`${folder}/yarn.lock`);
expect(doesYarnLockExist).toBeTruthy();
});

test.skip("When skipping installation, node_modules should not be there", async () => {
const folder = "yarn-skip";
await executeBashFunction(`node main.js ${folder} -y -s`);
const doesNodeModulesExist = await doesFileExist(`${folder}/node_modules`);
expect(doesNodeModulesExist).toBeTruthy();
});


});
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ script:
return `cd ${folder}${post ? post : ""} && ${str}`;
}
function install() {
return program.yarn ? "yarn add" : "npm install";
return program.yarn ? "yarn" : "npm install";
}
function readFile(filename, includeDirname = true) {
return new Promise((resolve, reject) => {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-react-matt",
"version": "0.0.82",
"version": "0.0.83",
"description": "React, Redux, Webpack, Babel, Jest, and code coverage all provided for you",
"main": "main-index.js",
"repository": {
Expand Down