diff --git a/test/unit/lib/plugin-utils.js b/test/unit/lib/plugin-utils.js new file mode 100644 index 000000000..418b562a1 --- /dev/null +++ b/test/unit/lib/plugin-utils.js @@ -0,0 +1,30 @@ +'use strict'; + +const {getSuitePath} = require('lib/plugin-utils').getHermioneUtils(); + +describe('getHermioneUtils', () => { + describe('getSuitePath', () => { + it('should return correct path for simple suite', () => { + const suite = {parent: {root: true}, title: 'some-title'}; + + const suitePath = getSuitePath(suite); + + assert.match(suitePath, ['some-title']); + }); + + it('should return correct path for complex suite', () => { + const suite = { + parent: { + parent: { + parent: {root: true}, title: 'root-title' + }, title: 'parent-title' + }, + title: 'some-title' + }; + + const suitePath = getSuitePath(suite); + + assert.match(suitePath, ['root-title', 'parent-title', 'some-title']); + }); + }); +});