Skip to content

Commit

Permalink
Used eql rather than equal to compare objects
Browse files Browse the repository at this point in the history
Changed sample jsons to reflect accurate output
  • Loading branch information
Rlin232 committed Dec 10, 2021
1 parent 7c9a84e commit 9b937dd
Show file tree
Hide file tree
Showing 12 changed files with 4,002 additions and 13 deletions.
2 changes: 1 addition & 1 deletion test/commands/burpsuite_mapper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ describe('Test burpsuite', () => {
.it('hdf-converter output test', () => {
const test = JSON.parse(fs.readFileSync(`${tmpobj.name}/burpsuitetest.json`, {encoding: 'utf-8'}))
const sample = JSON.parse(fs.readFileSync(path.resolve('./test/sample_jsons/burpsuite/zero.webappsecurity.json'), {encoding: 'utf-8'}))
expect(omitVersions(test)).to.equal(omitVersions(sample))
expect(omitVersions(test)).to.eql(omitVersions(sample))
})
})
2 changes: 1 addition & 1 deletion test/commands/jfrog-xray-mapper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ describe('Test jfrog_xray', () => {
.it('hdf-converter output test', () => {
const converted = JSON.parse(fs.readFileSync(`${tmpobj.name}/jfrogtest.json`, {encoding: 'utf-8'}))
const sample = JSON.parse(fs.readFileSync(path.resolve('./test/sample_jsons/jfrog_xray/jfrog-hdf.json'), {encoding: 'utf-8'}))
expect(omitVersions(converted)).to.equal(omitVersions(sample))
expect(omitVersions(converted)).to.eql(omitVersions(sample))
})
})
2 changes: 1 addition & 1 deletion test/commands/nikto-mapper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ describe('Test nikto', () => {
.it('hdf-converter output test', () => {
const test = JSON.parse(fs.readFileSync(`${tmpobj.name}/niktotest.json`, {encoding: 'utf-8'}))
const sample = JSON.parse(fs.readFileSync(path.resolve('./test/sample_jsons/nikto/nikto-hdf.json'), {encoding: 'utf-8'}))
expect(omitVersions(test)).to.equal(omitVersions(sample))
expect(omitVersions(test)).to.eql(omitVersions(sample))
})
})
2 changes: 1 addition & 1 deletion test/commands/sarif-mapper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ describe('Test sarif', () => {
.it('hdf-converter output test', () => {
const test = JSON.parse(fs.readFileSync(`${tmpobj.name}/sariftest.json`, {encoding: 'utf-8'}))
const sample = JSON.parse(fs.readFileSync(path.resolve('./test/sample_jsons/sarif/sarif-hdf.json'), {encoding: 'utf-8'}))
expect(omitVersions(test)).to.equal(omitVersions(sample))
expect(omitVersions(test)).to.eql(omitVersions(sample))
})
})
2 changes: 1 addition & 1 deletion test/commands/scoutsuite-mapper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ describe('Test scoutsuite', () => {
.it('hdf-converter output test', () => {
const test = JSON.parse(fs.readFileSync(`${tmpobj.name}/scoutsuitetest.json`, {encoding: 'utf-8'}))
const sample = JSON.parse(fs.readFileSync(path.resolve('./test/sample_jsons/scoutsuite/scoutsuite-hdf.json'), {encoding: 'utf-8'}))
expect(omitVersions(test)).to.equal(omitVersions(sample))
expect(omitVersions(test)).to.eql(omitVersions(sample))
})
})
2 changes: 1 addition & 1 deletion test/commands/xccdf-results-mapper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ describe('Test xccdf_results', () => {
.it('hdf-converter output test', () => {
const test = JSON.parse(fs.readFileSync(`${tmpobj.name}/xccdfresultstest.json`, {encoding: 'utf-8'}))
const sample = JSON.parse(fs.readFileSync(path.resolve('./test/sample_jsons/xccdf_results/xccdf-hdf.json'), {encoding: 'utf-8'}))
expect(omitVersions(test)).to.equal(omitVersions(sample))
expect(omitVersions(test)).to.eql(omitVersions(sample))
})
})
4 changes: 2 additions & 2 deletions test/commands/zap-mapper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ describe('Test zap', () => {
.it('hdf-converter output test - webgoat', () => {
const test = JSON.parse(fs.readFileSync(`${tmpobj.name}/zaptest-webgoat.json`, {encoding: 'utf-8'}))
const sample = JSON.parse(fs.readFileSync(path.resolve('./test/sample_jsons/zap/zap-webgoat-hdf.json'), {encoding: 'utf-8'}))
expect(omitVersions(test)).to.equal(omitVersions(sample))
expect(omitVersions(test)).to.eql(omitVersions(sample))
})
test
.stdout()
.command(['convert:zap', '-i', path.resolve('./test/sample_jsons/zap/sample_input_report/zero.webappsecurity.json'), '-n', 'http://zero.webappsecurity.com', '-o', `${tmpobj.name}/zaptest-webappsecurity.json`])
.it('hdf-converter output test - zero.webappsecurity', () => {
const test = JSON.parse(fs.readFileSync(`${tmpobj.name}/zaptest-webappsecurity.json`, {encoding: 'utf-8'}))
const sample = JSON.parse(fs.readFileSync(path.resolve('./test/sample_jsons/zap/zap-webappsecurity-hdf.json'), {encoding: 'utf-8'}))
expect(omitVersions(test)).to.equal(omitVersions(sample))
expect(omitVersions(test)).to.eql(omitVersions(sample))
})
})
807 changes: 806 additions & 1 deletion test/sample_jsons/burpsuite/zero.webappsecurity.json

Large diffs are not rendered by default.

377 changes: 376 additions & 1 deletion test/sample_jsons/nikto/nikto-hdf.json

Large diffs are not rendered by default.

982 changes: 981 additions & 1 deletion test/sample_jsons/sarif/sarif-hdf.json

Large diffs are not rendered by default.

487 changes: 486 additions & 1 deletion test/sample_jsons/scoutsuite/scoutsuite-hdf.json

Large diffs are not rendered by default.

1,346 changes: 1,345 additions & 1 deletion test/sample_jsons/zap/zap-webappsecurity-hdf.json

Large diffs are not rendered by default.

0 comments on commit 9b937dd

Please sign in to comment.