-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* starting check option * primed to move functionality down to function * shifting getSettings to async + tests * basic solidarity setup * properly parse json5 strings * move check to stack * now uses Solidarity Stacks repo * fix shortcut and help * verbiage chage * no more local file * fix folder flag * fixing up tests * break out helpers and write tests * fix for tsc * no more check folder * adding CLI Options docs * fix silent bug * fix naming collision * fix up tests Closes #213
- Loading branch information
Showing
21 changed files
with
275 additions
and
85 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
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,50 @@ | ||
import { isURI, loadFile, loadWebCheck } from '../../src/extensions/functions/getSolidarityHelpers' | ||
|
||
const context = require('mockContext') | ||
|
||
describe('Test helper functions', () => { | ||
describe('isURI', () => { | ||
test('isURI positive case', () => { | ||
expect(isURI('http://www.google.com')).toBeTruthy() | ||
expect(isURI('https://www.google.com')).toBeTruthy() | ||
}) | ||
|
||
test('isURI fail case', () => { | ||
expect(isURI('nachos')).toBeFalsy() | ||
expect(isURI('/nachos')).toBeFalsy() | ||
expect(isURI('./nachos')).toBeFalsy() | ||
}) | ||
|
||
}) | ||
|
||
describe('loadFile', () => { | ||
test('loadFile positive cases', () => { | ||
expect(loadFile(context, '__tests__/sandbox/solidarity_json')).toBeTruthy() | ||
expect(loadFile(context, '__tests__/sandbox/solidarity_json/.solidarity.json')).toBeTruthy() | ||
}) | ||
|
||
test('loadFile false cases', () => { | ||
expect(() => { | ||
loadFile(context, '__tests__/sandbox/fake_project') | ||
}).toThrow() | ||
expect(() => { | ||
loadFile(context, '__tests__/sandbox/fake_project/nope.solidarity') | ||
}).toThrow() | ||
}) | ||
}) | ||
|
||
// describe('loadModule', () => { | ||
// }) | ||
|
||
describe('loadWebCheck', () => { | ||
test('loadWebCheck positive cases', async () => { | ||
expect(await loadWebCheck(context, 'https://raw.githubusercontent.com/infinitered/solidarity-stacks/master/stacks/react-native.solidarity')).toBeTruthy() | ||
}) | ||
|
||
test('loadWebCheck false cases', async () => { | ||
await expect(loadWebCheck(context, 'https://raw.githubusercontent.com/infinitered/solidarity-stacks/master/stacks/failsauce')) | ||
.rejects | ||
.toThrow() | ||
}) | ||
}) | ||
}) |
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
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
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,55 @@ | ||
# Solidarity Command Options | ||
A listing of CLI options can be found by passing the `help` command to the CLI. | ||
|
||
``` | ||
$ solidarity help | ||
Solidarity | ||
Commands | ||
solidarity Check environment against solidarity rules | ||
create (c) Displays this help | ||
help (h) Displays this help | ||
report (r) Report solidarity info about the current machine | ||
snapshot (s) Take a snapshot of the versions and store in solidarity file | ||
Flags | ||
--verbose (-a) Prints all detected info during solidarity check | ||
--moderate (-m) Prints failures in check or single success message | ||
--silent (-s) No output, just a return code of success/failure | ||
--solidarityFile (-f) Use given path to solidarity file for settings | ||
--module (-d) Search for a solidarity file in the given npm package | ||
--stack (-t) Use a known technology stack, and not the local file | ||
Solidarity is open source - https://github.com/infinitered/solidarity | ||
If you need additional help, join our Slack at http://community.infinite.red | ||
``` | ||
|
||
Here we will go into detail on each option flag. | ||
|
||
## verbose (-a) | ||
Passing `--verbose` or `-a` flags will modify output to be verbose. | ||
|
||
## moderate (-m) | ||
Passing `--moderate` or `-m` flags will modify output to be moderate, meaning only failures exclusive or a single success will be printed. | ||
|
||
## silent (-s) | ||
Passing `--silent` or `-s` flags will modify output to be silent, meaning no output will occur. You'll have to see if the command return is non-zero to see if it failed. | ||
|
||
## solidarityFile (-f) | ||
Passing `--solidarityFile` or `-f` flags will direct the file to use for the solidarity check. | ||
|
||
> For example: `solidarity -solidarityFile ./my/special/file.json` will run the designated file instead of looking for a local folder Solidarity file. | ||
## module (-m) | ||
Passing `--module` or `-m` flags will modify the designated solidarity file, to run a file found in the given `node_module` stack. | ||
|
||
> For example: `solidarity --module smoothReporter` will run the solidarity file in the root of the npm package `smoothReporter` instead of our own. | ||
## stack (-t) | ||
Passing `--stack` or `-t` flags will make our stack look to GitHub for a well known tech stack. | ||
|
||
> For example: `solidarity --stack react-native` will check our machine if we are ready to run React Native projects, but not a specific React Native project. | ||
Stacks are community managed and found here: https://github.com/infinitered/solidarity-stacks |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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.