Skip to content

Commit 8239da5

Browse files
committed
chore: refactor tests
1 parent ceaa8ec commit 8239da5

File tree

1 file changed

+36
-36
lines changed

1 file changed

+36
-36
lines changed

test/spec.test.js

+36-36
Original file line numberDiff line numberDiff line change
@@ -16,34 +16,6 @@ describe('app.conf', () => {
1616
});
1717
});
1818

19-
describe('authorize.conf', () => {
20-
let specFileName = "authorize.conf.spec";
21-
let specFilePath = path.join(specFolderLocation, specFileVersion, specFileName)
22-
let specConfig = splunkSpec.getSpecConfig(extensionPath, specFilePath);
23-
24-
it('stanza "[role_org_custom]" should be valid', () => {
25-
assert.equal(splunkSpec.isStanzaValid(specConfig, "[role_org_custom]"), true);
26-
});
27-
});
28-
29-
describe('outputs.conf', () => {
30-
let specFileName = "outputs.conf.spec";
31-
let specFilePath = path.join(specFolderLocation, specFileVersion, specFileName)
32-
let specConfig = splunkSpec.getSpecConfig(extensionPath, specFilePath);
33-
34-
it('setting "useACK = true" should be valid for stanza [tcpout:default-autolb-group]', () => {
35-
assert.equal(splunkSpec.isSettingValid(specConfig, "[tcpout:default-autolb-group]", "useACK = true"), true);
36-
});
37-
38-
it('setting "useAck = true" should be invalid for stanza [tcpout:default-autolb-group]', () => {
39-
assert.notEqual(splunkSpec.isSettingValid(specConfig, "[tcpout:default-autolb-group]", "useAck = true"), true);
40-
});
41-
42-
it('setting "forwardedindex.filter.disable = true" should be valid for stanza [tcpout]', () => {
43-
assert.equal(splunkSpec.isSettingValid(specConfig, "[tcpout]", "forwardedindex.filter.disable = true"), true);
44-
});
45-
});
46-
4719
describe('authentication.conf', () => {
4820
let specFileName = "authentication.conf.spec";
4921
let specFilePath = path.join(specFolderLocation, specFileVersion, specFileName)
@@ -63,6 +35,26 @@ describe('authentication.conf', () => {
6335
});
6436
});
6537

38+
describe('authorize.conf', () => {
39+
let specFileName = "authorize.conf.spec";
40+
let specFilePath = path.join(specFolderLocation, specFileVersion, specFileName)
41+
let specConfig = splunkSpec.getSpecConfig(extensionPath, specFilePath);
42+
43+
it('stanza "[role_org_custom]" should be valid', () => {
44+
assert.equal(splunkSpec.isStanzaValid(specConfig, "[role_org_custom]"), true);
45+
});
46+
});
47+
48+
describe('deploymentclient.conf', () => {
49+
let specFileName = "deploymentclient.conf.spec";
50+
let specFilePath = path.join(specFolderLocation, specFileVersion, specFileName)
51+
let specConfig = splunkSpec.getSpecConfig(extensionPath, specFilePath);
52+
53+
it('setting "serverRepositoryLocationPolicy = rejectAlways" should be valid for stanza [deployment-client]', () => {
54+
assert.equal(splunkSpec.isSettingValid(specConfig, "[deployment-client]", "serverRepositoryLocationPolicy = rejectAlways"), true);
55+
});
56+
});
57+
6658
describe('distsearch.conf', () => {
6759
let specFileName = "distsearch.conf.spec";
6860
let specFilePath = path.join(specFolderLocation, specFileVersion, specFileName)
@@ -158,23 +150,31 @@ describe('inputs.conf', () => {
158150

159151
});
160152

161-
describe('searchbnf.conf', () => {
162-
let specFileName = "searchbnf.conf.spec";
153+
describe('outputs.conf', () => {
154+
let specFileName = "outputs.conf.spec";
163155
let specFilePath = path.join(specFolderLocation, specFileVersion, specFileName)
164156
let specConfig = splunkSpec.getSpecConfig(extensionPath, specFilePath);
165157

166-
it('setting "syntax = mything" should be valid for stanza [mything-command]', () => {
167-
assert.equal(splunkSpec.isSettingValid(specConfig, "[mything-command]", "syntax = mything"), true);
158+
it('setting "useACK = true" should be valid for stanza [tcpout:default-autolb-group]', () => {
159+
assert.equal(splunkSpec.isSettingValid(specConfig, "[tcpout:default-autolb-group]", "useACK = true"), true);
160+
});
161+
162+
it('setting "useAck = true" should be invalid for stanza [tcpout:default-autolb-group]', () => {
163+
assert.notEqual(splunkSpec.isSettingValid(specConfig, "[tcpout:default-autolb-group]", "useAck = true"), true);
164+
});
165+
166+
it('setting "forwardedindex.filter.disable = true" should be valid for stanza [tcpout]', () => {
167+
assert.equal(splunkSpec.isSettingValid(specConfig, "[tcpout]", "forwardedindex.filter.disable = true"), true);
168168
});
169169
});
170170

171-
describe('deploymentclient.conf', () => {
172-
let specFileName = "deploymentclient.conf.spec";
171+
describe('searchbnf.conf', () => {
172+
let specFileName = "searchbnf.conf.spec";
173173
let specFilePath = path.join(specFolderLocation, specFileVersion, specFileName)
174174
let specConfig = splunkSpec.getSpecConfig(extensionPath, specFilePath);
175175

176-
it('setting "serverRepositoryLocationPolicy = rejectAlways" should be valid for stanza [deployment-client]', () => {
177-
assert.equal(splunkSpec.isSettingValid(specConfig, "[deployment-client]", "serverRepositoryLocationPolicy = rejectAlways"), true);
176+
it('setting "syntax = mything" should be valid for stanza [mything-command]', () => {
177+
assert.equal(splunkSpec.isSettingValid(specConfig, "[mything-command]", "syntax = mything"), true);
178178
});
179179
});
180180

0 commit comments

Comments
 (0)