Skip to content

Commit f347172

Browse files
authored
Merge pull request #20 from cloudgraphdev/fix/EP-1988
fix: adapt CLI to pass data instead of queries
2 parents d4acc6e + dbaa7ce commit f347172

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

tests/operators/common.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ describe('Common Operators', () => {
2727
expect(CommonOperators.isEmpty({ key: 'one' }, true)).toBeFalsy()
2828
})
2929
test('Should fail given a null value', () => {
30-
expect(CommonOperators.isEmpty(null, true)).toBeFalsy()
30+
expect(CommonOperators.isEmpty(null, false)).toBeFalsy()
3131
})
3232
test('Should fail given an undefined value', () => {
33-
expect(CommonOperators.isEmpty(undefined, true)).toBeFalsy()
33+
expect(CommonOperators.isEmpty(undefined, false)).toBeFalsy()
3434
})
3535
test('Should fail given an integer', () => {
3636
expect(CommonOperators.isEmpty(33, true)).toBeFalsy()

tests/plugins/policyPack.test.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ const storageEngine = {
3636
run: jest.fn(),
3737
}
3838

39+
const providerData = {
40+
entities: [],
41+
connections: {}
42+
}
43+
3944
describe('PolicyPack Plugin', () => {
4045
let plugin
4146
beforeEach(() => {
@@ -71,12 +76,13 @@ describe('PolicyPack Plugin', () => {
7176
await plugin.execute({
7277
storageRunning: true,
7378
storageEngine,
79+
providerData,
7480
processConnectionsBetweenEntities: jest.fn(),
7581
})
7682

7783
expect(storageEngine.getSchema).toHaveBeenCalled()
7884
expect(storageEngine.setSchema).toHaveBeenCalled()
79-
expect(storageEngine.query).toHaveBeenCalledTimes(1)
85+
expect(storageEngine.query).toHaveBeenCalledTimes(0)
8086
expect(storageEngine.run).toHaveBeenCalledTimes(1)
8187
})
8288

@@ -96,12 +102,13 @@ describe('PolicyPack Plugin', () => {
96102
await plugin.execute({
97103
storageRunning: true,
98104
storageEngine,
105+
providerData,
99106
processConnectionsBetweenEntities: jest.fn(),
100107
})
101108

102109
expect(storageEngine.getSchema).toHaveBeenCalled()
103110
expect(storageEngine.setSchema).toHaveBeenCalled()
104-
expect(storageEngine.query).toHaveBeenCalledTimes(3)
111+
expect(storageEngine.query).toHaveBeenCalledTimes(0)
105112
expect(storageEngine.run).toHaveBeenCalledTimes(1)
106113
})
107114
})

0 commit comments

Comments
 (0)