Test that processorType is valid

This commit is contained in:
Sam Carlton 2022-07-18 18:03:38 -05:00
parent 37b97ba682
commit d9e37b473c

View file

@ -97,6 +97,16 @@ describe.concurrent('Apps', async () => {
// Expect that machoMeta.architectures is an array // Expect that machoMeta.architectures is an array
expect( Array.isArray( scan.info.machoMeta.architectures ) ).toBe( true ) expect( Array.isArray( scan.info.machoMeta.architectures ) ).toBe( true )
// Expect that processorType is a string
expect( typeof scan.info.machoMeta.architectures[0].processorType ).toBe( 'string' )
const validCPUTypes = [
'ANY', 'VAX', 'MC680', 'X86', 'MIPS', 'MC98000', 'HPPA', 'ARM', 'ARM64', 'MC88000', 'SPARC', 'I860', 'POWERPC', 'POWERPC64'
]
// Expect that processorType is a valid CPU type
expect( validCPUTypes.includes( scan.info.machoMeta.architectures[0].processorType ) ).toBe( true )
// Expect that first of machoMeta.architectures has processorSubType as string // Expect that first of machoMeta.architectures has processorSubType as string
expect( typeof scan.info.machoMeta.architectures[0].processorSubType ).toBeTruthy() expect( typeof scan.info.machoMeta.architectures[0].processorSubType ).toBeTruthy()