Skip to content

Commit

Permalink
add solidarity report function
Browse files Browse the repository at this point in the history
  • Loading branch information
GantMan committed Feb 4, 2018
1 parent 59fae5e commit b315d2c
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 7 deletions.
48 changes: 48 additions & 0 deletions __tests__/command_helpers/__snapshots__/solidarityReport.ts.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`solidarityReport structure the basic function generates the Result object 1`] = `
Object {
"basicInfo": Array [
Array [
"System Basics",
"Value",
],
Array [
"OS",
"macOS High Sierra 10.13.3",
],
Array [
"CPU",
"x64 Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz",
],
],
"cliRules": Array [
Array [
"Binary",
"Location",
"Version",
"Desired",
],
],
"envRules": Array [
Array [
"Environment Var",
"Value",
],
],
"filesystemRules": Array [
Array [
"Location",
"Type",
"Exists",
],
],
"shellRules": Array [
Array [
"Command",
"Pattern",
"Matches",
],
],
}
`;
9 changes: 2 additions & 7 deletions __tests__/command_helpers/printResults.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
import printResults from '../../src/extensions/functions/printResults'
import { SolidarityRunContext, SolidarityReportResults } from '../../src/types'
import { createReport } from '../../src/extensions/functions/solidarityReport'

let mockContext: SolidarityRunContext
let reportResults: SolidarityReportResults
describe('reviewRule', () => {
beforeEach(() => {
// fresh mock context
mockContext = require('mockContext')
reportResults = {
basicInfo: [['System Basics', 'Value'], ['OS', 'tacoOS'], ['CPU', 'hamsters in a wheel']],
cliRules: [['Binary', 'Location', 'Version', 'Desired']],
envRules: [['Environment Var', 'Value']],
filesystemRules: [['Location', 'Type', 'Exists']],
shellRules: [['Command', 'Pattern', 'Matches']],
}
reportResults = createReport()
})

test('printResults uses table', async () => {
Expand Down
10 changes: 10 additions & 0 deletions __tests__/command_helpers/solidarityReport.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { SolidarityReportResults } from '../../src/types'
import { createReport } from '../../src/extensions/functions/solidarityReport'

let reportResults: SolidarityReportResults
describe('solidarityReport structure', () => {
test('the basic function generates the Result object', () => {
let report = createReport()
expect(report).toMatchSnapshot()
})
})

0 comments on commit b315d2c

Please sign in to comment.