Closed dan-kez closed 7 years ago
The above doesn't work and I think it's due to not comparing deep lists.
In my case I don't actually care about the order of the lists. But I do need to know that the list has all of the items I'm asserting.
[ { nodeType: 'column', name: 'jqfyew76275hwe2q33di', forcedStatus: '', minStatus: 'PII', inheritedStatus: 'PII', INCOMING: { ACCESSED: [], CONTAINED: [], FOREIGNKEY: [Object] }, OUTGOING: { ACCESSED: [], CONTAINED: [ '/table/4laq6vxpi0yyf3gtlnmi' ] }, tableName: '4laq6vxpi0yyf3gtlnmi', foreignKey: 'daujccr2t3qaaotuik9' }, { nodeType: 'column', name: '3hxo8ph5695a044sfw29', forcedStatus: '', minStatus: 'HEALTH', inheritedStatus: 'HEALTH', INCOMING: { ACCESSED: [], CONTAINED: [] }, OUTGOING: { ACCESSED: [], CONTAINED: [ '/table/4laq6vxpi0yyf3gtlnmi' ] }, tableName: '4laq6vxpi0yyf3gtlnmi', foreignKey: '' }, { nodeType: 'column', name: 'nnqkqx2amqzr9qu8tzkt9', forcedStatus: '', minStatus: '', inheritedStatus: 'NONE', INCOMING: { ACCESSED: [], CONTAINED: [] }, OUTGOING: { ACCESSED: [], CONTAINED: [ '/table/4laq6vxpi0yyf3gtlnmi' ] }, tableName: '4laq6vxpi0yyf3gtlnmi', foreignKey: '' } ] to contain subset { CONTAINED: [ '/table/4laq6vxpi0yyf3gtlnmi' ] }
the example that you provided does not fit the concept of 'subset'. For your specific case i recommend you to use https://www.npmjs.com/package/traverse
The above doesn't work and I think it's due to not comparing deep lists.
In my case I don't actually care about the order of the lists. But I do need to know that the list has all of the items I'm asserting.