-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from yowainwright/init-build-node-modules
Init build node modules
- Loading branch information
Showing
11 changed files
with
1,770 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
packages/install-dependencies/__fixtures__/test.all.package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"name": "test-all-install-dependencies", | ||
"dependencies": { | ||
"ramda": "0.27.1", | ||
"typescript": "4.1.3", | ||
"ink": "^3.0.8" | ||
}, | ||
"devDependencies": { | ||
"jest": "26.6.3", | ||
"@types/ramda": "0.27.34" | ||
}, | ||
"installDependencies": { | ||
"include": { | ||
"react": "17.0.1", | ||
"@babel/core": "7.12.10", | ||
"typescript": "4.1.2" | ||
}, | ||
"ignore": [ | ||
"ramda" | ||
] | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
packages/install-dependencies/__fixtures__/test.ignore.package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"name": "test-ignore-install-dependencies", | ||
"dependencies": { | ||
"ramda": "0.27.1", | ||
"typescript": "4.1.3", | ||
"ink": "^3.0.8" | ||
}, | ||
"devDependencies": { | ||
"jest": "26.6.3", | ||
"@types/ramda": "0.27.34" | ||
}, | ||
"installDependencies": { | ||
"ignore": [ | ||
"ramda" | ||
] | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
packages/install-dependencies/__fixtures__/test.include.package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"name": "test-include-install-dependencies", | ||
"dependencies": { | ||
"ramda": "0.27.1", | ||
"typescript": "4.1.3", | ||
"ink": "^3.0.8" | ||
}, | ||
"devDependencies": { | ||
"jest": "26.6.3", | ||
"@types/ramda": "0.27.34" | ||
}, | ||
"installDependencies": { | ||
"include": { | ||
"react": "17.0.1", | ||
"@babel/core": "7.12.10", | ||
"typescript": "4.1.2" | ||
} | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
packages/install-dependencies/__fixtures__/test.package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"name": "test-install-dependencies", | ||
"description": "test install-dependencies", | ||
"dependencies": { | ||
"ramda": "0.27.1", | ||
"typescript": "4.1.3", | ||
"ink": "^3.0.8" | ||
}, | ||
"devDependencies": { | ||
"jest": "26.6.3", | ||
"@types/ramda": "0.27.34" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,31 @@ | ||
describe('build-node-modules', () => { | ||
it('needs tests') | ||
import fs from 'fs' | ||
import { exec } from 'child_process' | ||
|
||
const pathToInstallDependencies = './packages/install-dependencies/' | ||
const installDependencies = `ts-node ${pathToInstallDependencies}src/index.ts run` | ||
const configFixtureDirectory = `${pathToInstallDependencies}__fixtures__/` | ||
const standardTestPackageJson = `test.package.json` | ||
const testDirectory = `${pathToInstallDependencies}tests/` | ||
const standardTestDirectory = 'standard/' | ||
/** | ||
* @todo write more tests! | ||
* const ignoreTestPackageJson = `test.ignore.package.json` | ||
* const includeTestPackageJson = `test.include.package.json` | ||
* const allTestPackageJson = `test.all.package.json` | ||
*/ | ||
|
||
const cleanUpTestDirectory = () => exec(`rm -rf ${testDirectory}`) | ||
|
||
describe('install-dependencies', () => { | ||
it('installed dependencies', (done) => { | ||
const config = `${configFixtureDirectory}${standardTestPackageJson}` | ||
const dest = `${testDirectory}${standardTestDirectory}` | ||
const script = `${installDependencies} ${config} ${dest}` | ||
exec(script, () => { | ||
const isTestFolderEmpty = fs.readdirSync(dest) | ||
expect(isTestFolderEmpty.length).toEqual(2) | ||
cleanUpTestDirectory() | ||
done() | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.