Skip to content

Commit

Permalink
fix: add unit tests for plugin-utils
Browse files Browse the repository at this point in the history
  • Loading branch information
Rashid Ksirov committed Sep 27, 2019
1 parent 449ee78 commit 507f71c
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions test/unit/lib/plugin-utils.js
Original file line number Diff line number Diff line change
@@ -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']);
});
});
});

0 comments on commit 507f71c

Please sign in to comment.