-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into dependabot/npm_and_yarn/inquirer-9.2.8
- Loading branch information
Showing
6 changed files
with
848 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import {expect, test} from '@oclif/test' | ||
import tmp from 'tmp' | ||
import path from 'path' | ||
import fs from 'fs' | ||
import {omitHDFChangingFields} from '../utils' | ||
|
||
describe('Test Netsparker', () => { | ||
const tmpobj = tmp.dirSync({unsafeCleanup: true}) | ||
|
||
test | ||
.stdout() | ||
.command(['convert netsparker2hdf', '-i', path.resolve('./test/sample_data/netsparker/sample_input_report/sample-netsparker-invicti.xml'), '-o', `${tmpobj.name}/netsparkertest.json`]) | ||
.it('hdf-converter output test', () => { | ||
const test = JSON.parse(fs.readFileSync(`${tmpobj.name}/netsparkertest.json`, 'utf8')) | ||
const sample = JSON.parse(fs.readFileSync(path.resolve('./test/sample_data/netsparker/netsparker-hdf.json'), 'utf8')) | ||
expect(omitHDFChangingFields(test)).to.eql(omitHDFChangingFields(sample)) | ||
}) | ||
}) | ||
|
||
describe('Test Netsparker using withraw flag', () => { | ||
const tmpobj = tmp.dirSync({unsafeCleanup: true}) | ||
|
||
test | ||
.stdout() | ||
.command(['convert netsparker2hdf', '-i', path.resolve('./test/sample_data/netsparker/sample_input_report/sample-netsparker-invicti.xml'), '-o', `${tmpobj.name}/netsparkertest.json`, '-w']) | ||
.it('hdf-converter withraw output test', () => { | ||
const test = JSON.parse(fs.readFileSync(`${tmpobj.name}/netsparkertest.json`, 'utf8')) | ||
const sample = JSON.parse(fs.readFileSync(path.resolve('./test/sample_data/netsparker/netsparker-hdf-withraw.json'), 'utf8')) | ||
expect(omitHDFChangingFields(test)).to.eql(omitHDFChangingFields(sample)) | ||
}) | ||
}) |
327 changes: 327 additions & 0 deletions
327
test/sample_data/netsparker/netsparker-hdf-withraw.json
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.