Skip to content

Commit 32a8097

Browse files
committed
Merge branch 'master' of github.com:infinitered/solidarity
2 parents b611be3 + f7f6d94 commit 32a8097

28 files changed

+152
-151
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ notifications:
1616
urls:
1717
- 'https://www.travisbuddy.com/'
1818
on_success: never
19-
on_failure: always
19+
on_failure: never
2020
on_start: never
2121
on_cancel: never
2222
on_error: never

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,16 @@ No `.solidarity` file found for this project. Would you like to create one? (Y/
7171

7272
Custom rule-sets can be created by modifying the `.solidarity` file by hand, or by creating a solidarity plugin for a given technology. [See documentation](https://infinitered.github.io/solidarity/) for how you can create your own.
7373

74+
## How do I update my snapshots?
75+
Given there is already a `.solidarity` file present, then you can run `solidarity snapshot [rule]`
76+
77+
```sh
78+
$ solidarity snapshot cli node
79+
```
80+
81+
Solidarity will follow up with aditional questions to help drill down your new snapshot rule.
82+
83+
7484
## Cross Platform
7585
Solidarity works with Mac/Linux/Windows environments. CI tests all rules with each platform on every update.
7686

__tests__/command_helpers/appendSolidaritySettings.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import appendSolidaritySettings from '../../src/extensions/functions/appendSolidaritySettings'
22
import { keys } from 'ramda'
33
import solidarityExtension from '../../src/extensions/solidarity-extension'
4-
import { solidarity } from '../../src/types'
54

65
const context = require('mockContext')
76

__tests__/command_helpers/checkCLIForUpdates.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ describe('checkCLIForUpdates', () => {
3333
rule.binary = 'yarn'
3434
context.print = {
3535
colors: {
36-
green: jest.fn(string => string),
36+
green: jest.fn(stringy => stringy),
3737
},
3838
}
3939
})

__tests__/command_helpers/checkENV.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ test('checkENV detects set ENV', async () => {
1515
}
1616
// Use checkENV to make sure it exists
1717
expect(await checkENV({ variable: someRealEnvVar })).toBeTruthy()
18-
} else {
1918
}
2019
})
2120

__tests__/command_helpers/checkRequirement.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { SolidarityRequirement } from '../../dist/types'
21
import { toPairs } from 'ramda'
32
import { strings } from 'gluegun/toolbox'
43

@@ -59,7 +58,7 @@ describe('checkRequirement', () => {
5958
})
6059

6160
test('there is a spinner message', async () => {
62-
const result = await checkRequirement(badRule, context)
61+
await checkRequirement(badRule, context)
6362
expect(context.print.spin.mock.calls).toEqual([['Verifying YARN']])
6463
})
6564

__tests__/command_helpers/checkShell.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { ShellRule, SolidarityRunContext } from '../../src/types'
21
import { strings } from 'gluegun/toolbox'
32
const checkShell: any = require('../../src/extensions/functions/checkShell')
43

__tests__/command_helpers/getSolidaritySettings.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { solidarity } from '../../src'
21
import getSolidaritySettings from '../../src/extensions/functions/getSolidaritySettings'
32

43
const context = require('mockContext')
@@ -26,15 +25,15 @@ describe('basic getSolidaritySettings', () => {
2625
test('getSolidaritySettings can fail', () => {
2726
expect(() => {
2827
process.chdir('__tests__')
29-
const resultSettings = getSolidaritySettings(context)
28+
getSolidaritySettings(context)
3029
}).toThrow()
3130
process.chdir('../')
3231
})
3332

3433
test('getSolidaritySettings can warn with missing requirements', () => {
3534
expect(() => {
3635
process.chdir('__tests__/sandbox/solidarity_broken')
37-
const resultSettings = getSolidaritySettings(context)
36+
getSolidaritySettings(context)
3837
}).toThrowError('ERROR: Found, but no requirements key. Please validate your solidarity file')
3938
process.chdir('../../../')
4039
})
@@ -62,12 +61,12 @@ describe('parameterized getSolidaritySettings', () => {
6261
// test longhand
6362
context.parameters.options = { solidarityFile: '__tests__/fake' }
6463
expect(() => {
65-
const resultSettings = getSolidaritySettings(context)
64+
getSolidaritySettings(context)
6665
}).toThrowError('ERROR: There is no solidarity file at the given path')
6766
// test shorthand
6867
context.parameters.options = { f: '__tests__/fake' }
6968
expect(() => {
70-
const resultSettings = getSolidaritySettings(context)
69+
getSolidaritySettings(context)
7170
}).toThrowError('ERROR: There is no solidarity file at the given path')
7271
context.parameters.options = {}
7372
})
@@ -104,7 +103,7 @@ describe('parameterized getSolidaritySettings', () => {
104103
test('errors if no solidarity file in module', () => {
105104
context.parameters.options = { module: 'nope' }
106105
expect(() => {
107-
const resultSettings = getSolidaritySettings(context)
106+
getSolidaritySettings(context)
108107
}).toThrowError('ERROR: There is no solidarity file found with the given module')
109108
context.parameters.options = {}
110109
})

__tests__/command_helpers/reviewRule.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe('reviewRule', () => {
1515
test('rule gets added', async () => {
1616
const rule = ['NPM', [{ rule: 'cli', binary: 'npm' }]]
1717

18-
const result = await reviewRule(rule, reportResults, mockContext)
18+
await reviewRule(rule, reportResults, mockContext)
1919
// CLI rule was added
2020
expect(reportResults.cliRules.length).toBe(2)
2121
})
@@ -25,7 +25,7 @@ describe('reviewRule', () => {
2525
test('rule gets added', async () => {
2626
const rule = ['ANDROID', [{ rule: 'env', value: 'ANDROID_HOME' }]]
2727

28-
const result = await reviewRule(rule, reportResults, mockContext)
28+
reviewRule(rule, reportResults, mockContext)
2929
// CLI rule was added
3030
expect(reportResults.envRules.length).toBe(2)
3131
})
@@ -35,7 +35,7 @@ describe('reviewRule', () => {
3535
test('rule gets added', async () => {
3636
const rule = ['DIRECTORY', [{ rule: 'dir', binary: 'random' }]]
3737

38-
const result = await reviewRule(rule, reportResults, mockContext)
38+
reviewRule(rule, reportResults, mockContext)
3939
// CLI rule was added
4040
expect(reportResults.filesystemRules.length).toBe(2)
4141
})
@@ -45,7 +45,7 @@ describe('reviewRule', () => {
4545
test('rule gets added', async () => {
4646
const rule = ['FILE', [{ rule: 'file', binary: 'random' }]]
4747

48-
const result = await reviewRule(rule, reportResults, mockContext)
48+
reviewRule(rule, reportResults, mockContext)
4949
// CLI rule was added
5050
expect(reportResults.filesystemRules.length).toBe(2)
5151
})
@@ -55,9 +55,9 @@ describe('reviewRule', () => {
5555
test('rule gets added', async () => {
5656
const rule = ['SHELL', [{ rule: 'shell', command: 'ls', match: '.+' }]]
5757

58-
const result = await reviewRule(rule, reportResults, mockContext)
58+
reviewRule(rule, reportResults, mockContext)
5959
// SHELL rule was added
60-
expect(reportResults.shellRules.length).toBe(2)
60+
expect(reportResults.shellRules.length).toBe(1)
6161
})
6262
})
6363

@@ -67,7 +67,7 @@ describe('reviewRule', () => {
6767
const rule = ['CUSTOM', [{ rule: 'custom', plugin: 'Example Plugin', name: 'checkThing' }]]
6868

6969
expect(reportResults.cliRules.length).toBe(1)
70-
const result = await reviewRule(rule, reportResults, mockContext)
70+
await reviewRule(rule, reportResults, mockContext)
7171
// CUSTOM rule (which adds CLI report) was added
7272
expect(reportResults.cliRules.length).toBe(2)
7373
})
@@ -76,7 +76,7 @@ describe('reviewRule', () => {
7676
const rule = ['CUSTOM', [{ rule: 'custom', plugin: 'Example Plugin', name: 'checkSecondThing' }]]
7777

7878
expect(reportResults.cliRules.length).toBe(1)
79-
const result = await reviewRule(rule, reportResults, mockContext)
79+
await reviewRule(rule, reportResults, mockContext)
8080
// should not change rules
8181
expect(reportResults.cliRules.length).toBe(1)
8282
})

__tests__/command_helpers/solidarityReport.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { SolidarityReportResults } from '../../src/types'
22
import { createReport } from '../../src/extensions/functions/solidarityReport'
33
const context = require('mockContext')
44

5-
let reportResults: SolidarityReportResults
65
describe('solidarityReport structure', () => {
76
test('the basic function generates the Result object', () => {
87
let report = createReport(context)

0 commit comments

Comments
 (0)