|
1 | | -const moment = require('moment'); |
2 | | -const Config = require('../../src/include/config'); |
3 | | -const Time = require('./../../src/models/time'); |
4 | | -const issue = require('../../src/models/issue'); |
5 | | -const mergeRequest = require('../../src/models/mergeRequest'); |
6 | | -const expect = require('chai').expect; |
| 1 | + |
| 2 | +import moment from 'moment'; |
| 3 | +import Config from '../../src/include/file-config.js'; |
| 4 | +import Time from '../../src/models/time.js'; |
| 5 | +import issue from '../../src/models/issue.js'; |
| 6 | +import mergeRequest from '../../src/models/mergeRequest.js'; |
| 7 | +import { expect } from 'chai'; |
7 | 8 |
|
8 | 9 | describe('time class', () => { |
9 | 10 | it('Returns title of parent Issue', () => { |
10 | | - const config = new Config(); |
| 11 | + const config = new Config(process.cwd()); |
11 | 12 | const parent = new issue(config, {title: "Test title"}) |
12 | 13 | const time = new Time('1h', moment(), {}, parent, config); |
13 | 14 |
|
14 | 15 | expect(time.title).to.be.equal("Test title"); |
15 | 16 | }); |
16 | 17 |
|
17 | 18 | it('Returns title of parent MergeRequest', () => { |
18 | | - const config = new Config(); |
| 19 | + const config = new Config(process.cwd()); |
19 | 20 | const parent = new mergeRequest(config, {title: "Test title"}) |
20 | 21 | const time = new Time('1h', moment(), {}, parent, config); |
21 | 22 |
|
22 | 23 | expect(time.title).to.be.equal("Test title"); |
23 | 24 | }); |
24 | 25 |
|
25 | 26 | it('Returns Null for missed title or parent', () => { |
26 | | - const config = new Config(); |
| 27 | + const config = new Config(process.cwd()); |
27 | 28 | const parent = new mergeRequest(config, {}); |
28 | 29 | let time; |
29 | 30 | time = new Time('1h', moment(), {}, parent, config); |
|
0 commit comments