1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | 'use strict';
|
16 |
|
17 | const Util = require('../lib/util');
|
18 |
|
19 | const chai = require('chai');
|
20 |
|
21 | chai.should();
|
22 | chai.use(require('chai-things'));
|
23 | chai.use(require('chai-as-promised'));
|
24 |
|
25 | describe('Resolve root directory for Cucumber', () => {
|
26 | it('Should resolve to given root directory', function () {
|
27 | return Util.resolveRootDir({rootdir:'foo/bar'}).should.equal('foo/bar');
|
28 | });
|
29 | it('Should resolve to \'.\'', function () {
|
30 | return Util.resolveRootDir({}).should.equal('.');
|
31 | });
|
32 | });
|
33 | describe('Compare components corner cases', () => {
|
34 | it('Should succeed comparing null against null', function () {
|
35 | return (() => Util.compareComponent(null, null)).should.not.throw;
|
36 | });
|
37 | it('Should fail comparing null against 1', function () {
|
38 | return (() => Util.compareComponent(null, 1)).should.throw('expected 1 to equal null');
|
39 | });
|
40 | it('Should succeed comparing undefined against undefined', function () {
|
41 | return (() => Util.compareComponent(undefined, undefined)).should.not.throw;
|
42 | });
|
43 | it('Should fail comparing null against undefined', function () {
|
44 | return (() => Util.compareComponent(null, undefined)).should.throw('expected undefined to equal null');
|
45 | });
|
46 | it('Should resolve to \'.\'', function () {
|
47 | return Util.resolveRootDir({}).should.equal('.');
|
48 | });
|
49 | });
|