-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add unit tests for plugin-utils
- Loading branch information
Rashid Ksirov
committed
Sep 27, 2019
1 parent
449ee78
commit 507f71c
Showing
1 changed file
with
30 additions
and
0 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
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']); | ||
}); | ||
}); | ||
}); |